diff options
| author | boom2 <blizzack@blizzack.com> | 2023-12-14 17:24:25 -0500 |
|---|---|---|
| committer | boom2 <blizzack@blizzack.com> | 2023-12-14 17:24:25 -0500 |
| commit | f30709d7dbe88d82c4df66c476db36cb5c0ce903 (patch) | |
| tree | ca861d7aa3e30c73a4fefeb9186f221cf15a8ff5 /home/.ansible/roles/new_host/tasks/update_system_files.yml | |
| parent | d8a7729358a2fd3b911022e45d0197fda3e5da94 (diff) | |
- add "new_host" role for system setup
- no longer use "all" to mention all hosts in playbooks
- update of hosts file to now use localhost as "test"
Diffstat (limited to 'home/.ansible/roles/new_host/tasks/update_system_files.yml')
| -rw-r--r-- | home/.ansible/roles/new_host/tasks/update_system_files.yml | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/home/.ansible/roles/new_host/tasks/update_system_files.yml b/home/.ansible/roles/new_host/tasks/update_system_files.yml new file mode 100644 index 0000000..90e0851 --- /dev/null +++ b/home/.ansible/roles/new_host/tasks/update_system_files.yml @@ -0,0 +1,64 @@ +# - a sample / example of copying files from the controller to the managed nodes +# - and/or updating files in place +# +# https://docs.ansible.com/ansible/latest/collections/ansible/builtin/copy_module.html +# https://docs.ansible.com/ansible/latest/collections/ansible/builtin/lineinfile_module.html +# https://docs.python.org/3/library/re.html +# https://pythex.org/ + +# + +--- +- name: copy 'hosts.allow' to node(s) + ansible.builtin.copy: + src: hosts.allow + dest: "{{ backup_etc_dir }}/hosts.allow" + owner: root + group: root + mode: '0644' + tags: ['hosts.allow'] + +- name: copy 'hosts.deny' to node(s) + ansible.builtin.copy: + src: hosts.deny + dest: "{{ backup_etc_dir }}/hosts.deny" + owner: root + group: root + mode: '0644' + tags: ['hosts.deny'] + +- name: Validate the sudoers file before saving + ansible.builtin.lineinfile: + path: "{{ backup_etc_dir }}/sudoers" + state: present + regexp: '^# %wheel ALL=\(ALL:ALL\) ALL' + line: '%wheel ALL=(ALL:ALL) ALL' + validate: /usr/sbin/visudo -cf %s + tags: ['sudoers'] + +- name: copy 'rc.firewall' to node(s) + ansible.builtin.copy: + src: rc.firewall + dest: "{{ backup_etc_dir }}/rc.firewall" + owner: root + group: root + mode: '0755' + tags: ['rc.firewall'] + +- name: update slackpg mirror + ansible.builtin.lineinfile: + path: "{{ backup_etc_dir }}/mirrors" + state: present +# # slackware-current +# regexp: '^# https://mirror.slackbuilds.org/slackware/slackware64-current/' +# line: 'https://mirror.slackbuilds.org/slackware/slackware64-current/' + # slackware-15.0 + regexp: '^# https://mirror.slackbuilds.org/slackware/slackware64-15.0/' + line: 'https://mirror.slackbuilds.org/slackware/slackware64-15.0/' + tags: ['slackpkg_mirrors'] + + +#- name: update slackpg blacklist +# ansible.builtin.replace: +# path: "{{ backup_etc_dir }}/blacklist" + |
