* Need to become to reboot * Fix rc.local insertion of script * Fix syntax Add new line to lxc.yml * Remove need to set fact * Add reset for LXC container config * Fix syntax Its always the newlines.. * remove fact setting from reset task We should mirror the deployment task * Proxmox LXC reset functions * Handle if rc.local already has data * Dont compare literal * Cleanup Erroneous newline * Handle rc.local not present on a hybrid cluster * Update roles/reset/tasks/main.yml Co-authored-by: Simon Leiner <simon@leiner.me> * Update roles/lxc/tasks/main.yml Co-authored-by: Simon Leiner <simon@leiner.me> --------- Co-authored-by: Techno Tim <timothystewart6@gmail.com> Co-authored-by: Simon Leiner <simon@leiner.me>
22 lines
459 B
YAML
22 lines
459 B
YAML
---
|
|
- name: Check for rc.local file
|
|
stat:
|
|
path: /etc/rc.local
|
|
register: rcfile
|
|
|
|
- name: Create rc.local if needed
|
|
lineinfile:
|
|
path: /etc/rc.local
|
|
line: "#!/bin/sh -e"
|
|
create: true
|
|
insertbefore: BOF
|
|
mode: "u=rwx,g=rx,o=rx"
|
|
when: not rcfile.stat.exists
|
|
|
|
- name: Write rc.local file
|
|
blockinfile:
|
|
path: /etc/rc.local
|
|
content: "{{ lookup('template', 'templates/rc.local.j2') }}"
|
|
state: present
|
|
notify: reboot server
|