ansible/roles/basic_common_settings/tasks/update_script.yml

43 lines
1 KiB
YAML
Raw Normal View History

2022-12-14 17:43:16 +01:00
---
- name: "Ensure /opt/scripts/ exists"
ansible.builtin.file:
path: /opt/scripts
state: directory
mode: '0755'
- name: "Create directory (/etc/sudoers.d)"
ansible.builtin.file:
path: /etc/sudoers.d
state: directory
owner: root
group: root
mode: '0755'
- name: "Sudoers (/etc/sudoers.d/97-update.conf)"
ansible.builtin.template:
src: ../files/97-update.conf
dest: /etc/sudoers.d/97-update-conf
owner: root
group: root
mode: '0440'
when: ansible_os_family != 'OpenBSD' # sudo Installation must be fixed first for OpenBSD
- name: "Template Update Script"
ansible.builtin.template:
src: ../templates/update.sh.j2
dest: /opt/scripts/update.sh
owner: root
group: root
mode: u+rwx
when: ansible_os_family == 'Debian'
- name: "Template Update Script"
ansible.builtin.template:
src: ../templates/update.sh.j2
dest: /opt/scripts/update.sh
owner: root
group: wheel
mode: u+rwx
when: ansible_os_family == 'FreeBSD' or ansible_os_family == 'OpenBSD'