# - 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"