fabrica/.packer/provisioning/playbooks/eole/provision.yml

82 lines
2.0 KiB
YAML

---
- name: Provision Cadoles Server
hosts: all
tasks:
- name : Install One Context tool !
apt:
deb: https://github.com/OpenNebula/addon-context-linux/releases/download/v5.8.0/one-context_5.8.0-1.deb
environment:
HTTP_PROXY: "{{ http_proxy }}"
HTTPS_PROXY: "{{ https_proxy }}"
http_proxy: "{{ http_proxy }}"
https_proxy: "{{ https_proxy }}"
- name : Install JQ
apt:
name: jq
environment:
HTTP_PROXY: "{{ http_proxy }}"
HTTPS_PROXY: "{{ https_proxy }}"
http_proxy: "{{ http_proxy }}"
https_proxy: "{{ https_proxy }}"
- name : Add cadoles context script
command: mv /root/net-99-eole /etc/one-context.d/net-99-eole
- name: Make cadoles context script executable
file:
path: /etc/one-context.d/net-99-eole
mode: '+x'
- name: Copy sshd_template to modif directory
command: cp /usr/share/eole/creole/distrib/sshd_config /usr/share/eole/creole/modif/sshd_config
- name: Allow TCP Forwarding to ease GenConfig usage
lineinfile:
path: /usr/share/eole/creole/modif/sshd_config
regexp: '^AllowTcpForwarding'
line: 'AllowTcpForwarding yes'
- name: Gen_Patch
command: gen_patch
- name: Update Hostname
command: hostnamectl set-hostname eolebase272
- name: Cleanup
apt:
autoclean: yes
autoremove: yes
- name: Disable gpm
systemd:
name: gpm
enabled: no
masked: yes
- name: Disable NUT Driver
systemd:
name: nut-driver
enabled: no
masked: yes
- name: Disable NUT Monitor
systemd:
name: nut-monitor
enabled: no
masked: yes
- name: FSTRIM
command: fstrim -av
- name: Zero out the disk
command: dd if=/dev/zero of=/mytempfile
ignore_errors: yes
- name: Cleaup zero file
command: rm -rf /mytempfile
- name: Sync disk
command: sync