From 7f6b52b2257f53a9bd1260616d3d8b8e3634e5d2 Mon Sep 17 00:00:00 2001 From: Jacob Babor Date: Thu, 16 Jun 2022 23:45:29 -0500 Subject: [PATCH] Make the FQCN warning happy again --- handlers/main.yml | 4 ++-- playbooks/all.yml | 2 +- playbooks/all_scanner.yml | 4 ++-- playbooks/cleanup.yml | 2 +- playbooks/device_roles_workstation.yml | 2 +- playbooks/home_app.yml | 8 ++++---- playbooks/home_bastion.yml | 2 +- playbooks/home_fs.yml | 2 +- playbooks/home_media.yml | 2 +- playbooks/local_dns.yml | 2 +- playbooks/manufacturers_raspi.yml | 2 +- playbooks/manufacturers_s76.yml | 4 ++-- playbooks/prod_web.yml | 2 +- playbooks/tags_ansible-pull.yml | 2 +- playbooks/tags_autoreboot.yml | 6 +++--- playbooks/tags_nagios.yml | 10 +++++----- playbooks/tags_snmp.yml | 2 +- playbooks/tasks/web/nextcloud.yml | 4 ++-- roles/adminuser/tasks/main.yml | 8 ++++---- roles/ansible-pull/handlers/main.yml | 2 +- roles/ansible-pull/tasks/main.yml | 10 +++++----- roles/backup/handlers/main.yml | 2 +- roles/backup/tasks/main.yml | 10 +++++----- roles/common/handlers/main.yml | 4 ++-- roles/common/tasks/ansible.yml | 6 +++--- roles/common/tasks/packages.yml | 10 +++++----- roles/common/tasks/system.yml | 6 +++--- roles/desktop/handlers/main.yml | 2 +- roles/desktop/tasks/main.yml | 4 ++-- roles/desktop/tasks/packages.yml | 20 ++++++++++---------- roles/docker-tmodloader13/tasks/main.yml | 15 ++++++++------- roles/git/tasks/main.yml | 2 +- roles/grub/handlers/main.yml | 2 +- roles/grub/tasks/main.yml | 2 +- roles/ingress/tasks/main.yml | 4 ++-- roles/motd/tasks/main.yml | 6 +++--- roles/nagios/tasks/main.yml | 8 ++++---- roles/pulseaudio/tasks/main.yml | 10 +++++----- roles/udev/handlers/main.yml | 2 +- roles/udev/tasks/main.yml | 2 +- roles/zerotier/handlers/main.yml | 2 +- roles/zerotier/tasks/main.yml | 14 +++++++------- 42 files changed, 108 insertions(+), 107 deletions(-) diff --git a/handlers/main.yml b/handlers/main.yml index 770cb08..44d1650 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -1,8 +1,8 @@ #!/usr/bin/env ansible-playbook # vim:ft=ansible: - name: restart cron - service: name=cron state=restarted + ansible.builtin.service: name=cron state=restarted become: yes - name: regen initramfs - command: /usr/sbin/update-initramfs -c -k all + ansible.builtin.command: /usr/sbin/update-initramfs -c -k all become: yes diff --git a/playbooks/all.yml b/playbooks/all.yml index 33ac4ec..62d847e 100755 --- a/playbooks/all.yml +++ b/playbooks/all.yml @@ -5,7 +5,7 @@ - hosts: all tasks: - name: collect service facts - service_facts: + ansible.builtin.service_facts: tags: [ always ] roles: - role: common diff --git a/playbooks/all_scanner.yml b/playbooks/all_scanner.yml index eb68d9b..c4cab95 100755 --- a/playbooks/all_scanner.yml +++ b/playbooks/all_scanner.yml @@ -5,8 +5,8 @@ gather_facts: no tasks: - name: assure scanner user - user: name=scanner state=absent + ansible.builtin.user: name=scanner state=absent tags: [ scanner, greenbone ] - name: assure scanner user sudoers rule - lineinfile: path=/etc/sudoers line="scanner ALL=(ALL:ALL) NOPASSWD:ALL" state=absent + ansible.builtin.lineinfile: path=/etc/sudoers line="scanner ALL=(ALL:ALL) NOPASSWD:ALL" state=absent tags: [ scanner, greenbone ] diff --git a/playbooks/cleanup.yml b/playbooks/cleanup.yml index a477bfc..0d5b8f3 100755 --- a/playbooks/cleanup.yml +++ b/playbooks/cleanup.yml @@ -5,5 +5,5 @@ gather_facts: no tasks: - name: touch ansible timestamp file - file: path=/var/lib/ansible-last-run state=touch mode='0644' + ansible.builtin.file: path=/var/lib/ansible-last-run state=touch mode='0644' changed_when: no diff --git a/playbooks/device_roles_workstation.yml b/playbooks/device_roles_workstation.yml index a5d1514..1f99fef 100755 --- a/playbooks/device_roles_workstation.yml +++ b/playbooks/device_roles_workstation.yml @@ -5,7 +5,7 @@ - hosts: device_roles_workstation tasks: - name: assure vm-fs-1 nfs mountpoint - file: path=/nfs/vm-fs-1.home.mgmt.desu.ltd state=directory owner=root group=root mode=0755 + ansible.builtin.file: path=/nfs/vm-fs-1.home.mgmt.desu.ltd state=directory owner=root group=root mode=0755 tags: [ desktop, nfs ] - name: assure vm-fs-1 nfs mount mount: path=/nfs/vm-fs-1.home.mgmt.desu.ltd src=vm-fs-1.home.mgmt.desu.ltd:/nfs fstype=nfs4 opts="rsize=10248576,wsize=1048576,soft,timeo=600,retrans=2,_netdev" state=mounted diff --git a/playbooks/home_app.yml b/playbooks/home_app.yml index 98bb450..0482684 100755 --- a/playbooks/home_app.yml +++ b/playbooks/home_app.yml @@ -78,7 +78,7 @@ tags: [ docker ] tasks: - name: assure nfs mount directory - file: path=/data/syncthing/data state=directory mode=0755 + ansible.builtin.file: path=/data/syncthing/data state=directory mode=0755 tags: [ storage ] - name: assure nfs mount mount: path=/data/syncthing/data src=192.168.190.1:/nfs/syncthing fstype=nfs4 opts="rsize=10248576,wsize=1048576,soft,timeo=600,retrans=2,_netdev" state=mounted @@ -89,7 +89,7 @@ - app/syncthing.yml tags: [ always ] - name: assure movement cronjobs - cron: + ansible.builtin.cron: name: "{{ item.name }}" minute: 0 hour: 5 @@ -116,14 +116,14 @@ dest: Pictures/Screenshots/Vidya/Cyberpunk 2077 tags: [ cron ] - name: assure zone identifier cleanup cronjob - cron: + ansible.builtin.cron: name: cleanup zone.identtifier minute: 0 hour: 3 job: 'find /data/syncthing/data/ -type f -iname "*:Zone.Identifier" -delete' tags: [ cron ] - name: assure filename sanitize cronjobs - cron: + ansible.builtin.cron: name: "sanitize {{ item }}" minute: 0 hour: 4 diff --git a/playbooks/home_bastion.yml b/playbooks/home_bastion.yml index bec6c78..152bf0f 100755 --- a/playbooks/home_bastion.yml +++ b/playbooks/home_bastion.yml @@ -5,7 +5,7 @@ gather_facts: no tasks: - name: assure nfs mount directory - file: path=/nfs/projects state=directory mode=0755 + ansible.builtin.file: path=/nfs/projects state=directory mode=0755 tags: [ storage ] - name: assure nfs mount mount: path=/nfs/projects src=192.168.190.1:/nfs/projects fstype=nfs4 opts="rsize=10248576,wsize=1048576,soft,timeo=600,retrans=2,_netdev" state=mounted diff --git a/playbooks/home_fs.yml b/playbooks/home_fs.yml index 38f89b9..61b5309 100755 --- a/playbooks/home_fs.yml +++ b/playbooks/home_fs.yml @@ -5,7 +5,7 @@ - hosts: vm-fs-1.home.mgmt.desu.ltd tasks: - name: assure nfs directory - file: path=/nfs state=directory mode=0755 + ansible.builtin.file: path=/nfs state=directory mode=0755 roles: - role: backup vars: diff --git a/playbooks/home_media.yml b/playbooks/home_media.yml index 2ca4ce1..a2174f4 100755 --- a/playbooks/home_media.yml +++ b/playbooks/home_media.yml @@ -10,7 +10,7 @@ pull: yes pre_tasks: - name: assure nfs mount directory - file: path=/data state=directory mode=0755 + ansible.builtin.file: path=/data state=directory mode=0755 tags: [ pis, storage ] - name: assure nfs mount mount: path=/data/shared src=192.168.190.1:/nfs/media fstype=nfs4 opts="rsize=10248576,wsize=1048576,soft,timeo=600,retrans=2,_netdev" state=mounted diff --git a/playbooks/local_dns.yml b/playbooks/local_dns.yml index fe174dd..baa0da2 100755 --- a/playbooks/local_dns.yml +++ b/playbooks/local_dns.yml @@ -25,7 +25,7 @@ overwrite: yes tasks: - name: clear host errors before dns loop - meta: clear_host_errors + ansible.builtin.meta: clear_host_errors - name: configure dns block: - name: configure main mgmt dns diff --git a/playbooks/manufacturers_raspi.yml b/playbooks/manufacturers_raspi.yml index 23def5a..c298520 100755 --- a/playbooks/manufacturers_raspi.yml +++ b/playbooks/manufacturers_raspi.yml @@ -6,7 +6,7 @@ gather_facts: no tasks: - name: install raspi packages - apt: + ansible.builtin.apt: name: - libraspberrypi-bin tags: [ pis, packages ] diff --git a/playbooks/manufacturers_s76.yml b/playbooks/manufacturers_s76.yml index 37a2990..8c427c9 100755 --- a/playbooks/manufacturers_s76.yml +++ b/playbooks/manufacturers_s76.yml @@ -6,9 +6,9 @@ - name: configure system76 for apt block: - name: ensure system76 repo - apt_repository: repo="ppa:system76-dev/stable" + ansible.builtin.apt_repository: repo="ppa:system76-dev/stable" - name: ensure system76 packages - apt: + ansible.builtin.apt: name: - firmware-manager - kamoso diff --git a/playbooks/prod_web.yml b/playbooks/prod_web.yml index 0443778..75f3e7d 100755 --- a/playbooks/prod_web.yml +++ b/playbooks/prod_web.yml @@ -136,7 +136,7 @@ pull: yes pre_tasks: - name: clear host errors - meta: clear_host_errors + ansible.builtin.meta: clear_host_errors tasks: - name: ensure docker network docker_network: name=web diff --git a/playbooks/tags_ansible-pull.yml b/playbooks/tags_ansible-pull.yml index 4cd21dc..e51c83d 100755 --- a/playbooks/tags_ansible-pull.yml +++ b/playbooks/tags_ansible-pull.yml @@ -19,7 +19,7 @@ gather_facts: no tasks: - name: disable ansible-pull when not tagged - systemd: name={{ item }} state=stopped enabled=no + ansible.builtin.systemd: name={{ item }} state=stopped enabled=no with_items: - ansible-pull.timer - ansible-pull.service diff --git a/playbooks/tags_autoreboot.yml b/playbooks/tags_autoreboot.yml index 20d9fae..a872822 100755 --- a/playbooks/tags_autoreboot.yml +++ b/playbooks/tags_autoreboot.yml @@ -14,7 +14,7 @@ serial: 1 tasks: - name: check for reboot-required - stat: path=/var/run/reboot-required + ansible.builtin.stat: path=/var/run/reboot-required register: s - name: reboot block: @@ -30,7 +30,7 @@ delegate_to: web3.dallas.mgmt.desu.ltd rescue: - name: notify of failure to reboot - debug: msg="Miscellaneous failure when scheduling downtime" + ansible.builtin.debug: msg="Miscellaneous failure when scheduling downtime" - name: reboot - reboot: reboot_timeout=600 + ansible.builtin.reboot: reboot_timeout=600 when: s.stat.exists diff --git a/playbooks/tags_nagios.yml b/playbooks/tags_nagios.yml index 52907d5..773622b 100755 --- a/playbooks/tags_nagios.yml +++ b/playbooks/tags_nagios.yml @@ -12,10 +12,10 @@ tags: [ nagios, git ] tasks: - name: assure nagios plugin packages - apt: name=monitoring-plugins,nagios-plugins-contrib + ansible.builtin.apt: name=monitoring-plugins,nagios-plugins-contrib tags: [ nagios ] - name: assure nagios user - user: name=nagios-checker state=present system=yes + ansible.builtin.user: name=nagios-checker state=present system=yes tags: [ nagios ] - name: assure nagios user ssh key authorized_key: @@ -24,10 +24,10 @@ key: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKNavw28C0mKIQVRLQDW2aoovliU1XCGaenDhIMwumK/ Nagios monitoring" tags: [ nagios ] - name: assure nagios user sudo rule file - file: path=/etc/sudoers.d/50-nagios-checker mode=0750 owner=root group=root state=touch modification_time=preserve access_time=preserve + ansible.builtin.file: path=/etc/sudoers.d/50-nagios-checker mode=0750 owner=root group=root state=touch modification_time=preserve access_time=preserve tags: [ nagios, sudo ] - name: assure nagios user sudo rules - lineinfile: + ansible.builtin.lineinfile: path: /etc/sudoers.d/50-nagios-checker line: "nagios-checker ALL = (root) NOPASSWD: {{ item }}" with_items: @@ -39,6 +39,6 @@ gather_facts: no tasks: - name: disable nagios user when not tagged - user: name=nagios-checker state=absent remove=yes + ansible.builtin.user: name=nagios-checker state=absent remove=yes when: "'tags_nagios' not in group_names" tags: [ nagios ] diff --git a/playbooks/tags_snmp.yml b/playbooks/tags_snmp.yml index 2f86e82..e033a74 100755 --- a/playbooks/tags_snmp.yml +++ b/playbooks/tags_snmp.yml @@ -24,7 +24,7 @@ gather_facts: no tasks: - name: disable snmpd when not tagged - systemd: name={{ item }} state=stopped enabled=no + ansible.builtin.systemd: name={{ item }} state=stopped enabled=no with_items: - snmpd.service when: "'tags_snmp' not in group_names and item in services" diff --git a/playbooks/tasks/web/nextcloud.yml b/playbooks/tasks/web/nextcloud.yml index 759c4c3..68d1ec1 100644 --- a/playbooks/tasks/web/nextcloud.yml +++ b/playbooks/tasks/web/nextcloud.yml @@ -25,8 +25,8 @@ - /srv/desu.ltd/nc:/var/www/html/data tags: [ docker, nextcloud ] - name: assure nextcloud cron cronjob - cron: user=root name=nextcloud minute=*/5 job="docker exec --user www-data nextcloud php -f /var/www/html/cron.php" + ansible.builtin.cron: user=root name=nextcloud minute=*/5 job="docker exec --user www-data nextcloud php -f /var/www/html/cron.php" tags: [ docker, nextcloud, cron ] - name: assure nextcloud update cronjob - cron: user=root name=nextcloud-update minute=*/30 job="docker exec --user www-data nextcloud php occ app:update --all" + ansible.builtin.cron: user=root name=nextcloud-update minute=*/30 job="docker exec --user www-data nextcloud php occ app:update --all" tags: [ docker, nextcloud, cron ] diff --git a/roles/adminuser/tasks/main.yml b/roles/adminuser/tasks/main.yml index 3afed85..96c1ce3 100644 --- a/roles/adminuser/tasks/main.yml +++ b/roles/adminuser/tasks/main.yml @@ -1,13 +1,13 @@ #!/usr/bin/env ansible-playbook # vim:ft=ansible: - name: assure admin user - user: + ansible.builtin.user: name: "{{ adminuser_name }}" append: "{{ adminuser_groups_append }}" groups: "{{ adminuser_groups + adminuser_groups_extra }}" shell: "{{ adminuser_shell }}" - name: assure admin user ssh key - user: + ansible.builtin.user: name: "{{ adminuser_name }}" generate_ssh_key: yes ssh_key_type: "{{ adminuser_ssh_key_type }}" @@ -20,8 +20,8 @@ authorized_key: state=absent user={{ adminuser_name }} key={{ item }} loop: "{{ adminuser_ssh_unauthorized_keys }}" - name: assure admin user pass - user: name={{ adminuser_name }} password={{ adminuser_password }} + ansible.builtin.user: name={{ adminuser_name }} password={{ adminuser_password }} when: adminuser_password is defined - name: assure admin user sudo rule - lineinfile: path=/etc/sudoers line={{ adminuser_sudo_rule }} + ansible.builtin.lineinfile: path=/etc/sudoers line={{ adminuser_sudo_rule }} when: adminuser_sudo diff --git a/roles/ansible-pull/handlers/main.yml b/roles/ansible-pull/handlers/main.yml index ec085e4..5824c34 100644 --- a/roles/ansible-pull/handlers/main.yml +++ b/roles/ansible-pull/handlers/main.yml @@ -1,5 +1,5 @@ #!/usr/bin/env ansible-playbook # vim:ft=ansible: - name: restart ansiblepull timer - systemd: daemon_reload=yes name=ansible-pull.timer enabled=yes state=started + ansible.builtin.systemd: daemon_reload=yes name=ansible-pull.timer enabled=yes state=started become: yes diff --git a/roles/ansible-pull/tasks/main.yml b/roles/ansible-pull/tasks/main.yml index 98d1c21..236a0f8 100644 --- a/roles/ansible-pull/tasks/main.yml +++ b/roles/ansible-pull/tasks/main.yml @@ -1,15 +1,15 @@ #!/usr/bin/env ansible-playbook # vim:ft=ansible: - name: assure vault password file - copy: src=vaultpass dest="~/ansiblevaultpass" mode="0600" + ansible.builtin.copy: src=vaultpass dest="~/ansiblevaultpass" mode="0600" become: yes become_user: ansible - name: install ansible - pip: name=ansible<5,ansible-lint state=latest + ansible.builtin.pip: name=ansible<5,ansible-lint state=latest - name: configure systemd service - template: src=ansible-pull.service dest=/etc/systemd/system/ansible-pull.service mode=0644 + ansible.builtin.template: src=ansible-pull.service dest=/etc/systemd/system/ansible-pull.service mode=0644 - name: configure systemd timer - template: src=ansible-pull.timer dest=/etc/systemd/system/ansible-pull.timer mode=0644 + ansible.builtin.template: src=ansible-pull.timer dest=/etc/systemd/system/ansible-pull.timer mode=0644 notify: restart ansiblepull timer - name: enable timer - systemd: daemon_reload=yes name=ansible-pull.timer enabled=yes state=started + ansible.builtin.systemd: daemon_reload=yes name=ansible-pull.timer enabled=yes state=started diff --git a/roles/backup/handlers/main.yml b/roles/backup/handlers/main.yml index 9146a0e..343dae3 100644 --- a/roles/backup/handlers/main.yml +++ b/roles/backup/handlers/main.yml @@ -2,5 +2,5 @@ # vim:ft=ansible: --- - name: restart backup timer - systemd: name=backup.timer state=restarted daemon_reload=yes + ansible.builtin.systemd: name=backup.timer state=restarted daemon_reload=yes become: yes diff --git a/roles/backup/tasks/main.yml b/roles/backup/tasks/main.yml index 2880cce..6fd4b8e 100644 --- a/roles/backup/tasks/main.yml +++ b/roles/backup/tasks/main.yml @@ -2,13 +2,13 @@ # vim:ft=ansible: --- - name: template out backup script - template: src={{ backup_script }}.sh dest=/opt/backup.sh mode=0700 owner=root group=root + ansible.builtin.template: src={{ backup_script }}.sh dest=/opt/backup.sh mode=0700 owner=root group=root - name: template out restore script - template: src={{ restore_script }}.sh dest=/opt/restore.sh mode=0700 owner=root group=root + ansible.builtin.template: src={{ restore_script }}.sh dest=/opt/restore.sh mode=0700 owner=root group=root - name: configure systemd service - template: src=backup.service dest=/etc/systemd/system/backup.service mode=0644 + ansible.builtin.template: src=backup.service dest=/etc/systemd/system/backup.service mode=0644 - name: configure systemd timer - template: src=backup.timer dest=/etc/systemd/system/backup.timer mode=0644 + ansible.builtin.template: src=backup.timer dest=/etc/systemd/system/backup.timer mode=0644 notify: restart backup timer - name: enable timer - systemd: name=backup.timer state=started enabled=yes daemon_reload=yes + ansible.builtin.systemd: name=backup.timer state=started enabled=yes daemon_reload=yes diff --git a/roles/common/handlers/main.yml b/roles/common/handlers/main.yml index 770cb08..44d1650 100644 --- a/roles/common/handlers/main.yml +++ b/roles/common/handlers/main.yml @@ -1,8 +1,8 @@ #!/usr/bin/env ansible-playbook # vim:ft=ansible: - name: restart cron - service: name=cron state=restarted + ansible.builtin.service: name=cron state=restarted become: yes - name: regen initramfs - command: /usr/sbin/update-initramfs -c -k all + ansible.builtin.command: /usr/sbin/update-initramfs -c -k all become: yes diff --git a/roles/common/tasks/ansible.yml b/roles/common/tasks/ansible.yml index 1ed2043..58686b4 100644 --- a/roles/common/tasks/ansible.yml +++ b/roles/common/tasks/ansible.yml @@ -1,10 +1,10 @@ #!/usr/bin/env ansible-playbook # vim:ft=ansible: - name: create ansible user - user: name=ansible password_lock=yes + ansible.builtin.user: name=ansible password_lock=yes - name: configure ansible user home directory - file: path=/home/ansible owner=ansible group=ansible + ansible.builtin.file: path=/home/ansible owner=ansible group=ansible - name: configure ansible user keys authorized_key: user=ansible manage_dir=yes key={{ common_ansible_pubkey }} - name: configure ansible user sudo - lineinfile: path=/etc/sudoers line="ansible ALL=(ALL:ALL) NOPASSWD:ALL" + ansible.builtin.lineinfile: path=/etc/sudoers line="ansible ALL=(ALL:ALL) NOPASSWD:ALL" diff --git a/roles/common/tasks/packages.yml b/roles/common/tasks/packages.yml index bc7aad4..5665569 100644 --- a/roles/common/tasks/packages.yml +++ b/roles/common/tasks/packages.yml @@ -3,9 +3,9 @@ - name: configure packages via apt block: - name: update apt packages - apt: upgrade=yes update_cache=yes cache_valid_time=86400 + ansible.builtin.apt: upgrade=yes update_cache=yes cache_valid_time=86400 - name: install basic packages - apt: + ansible.builtin.apt: name: - acl - apt-file @@ -37,9 +37,9 @@ - vim - whois - name: remove basic packages - apt: state=absent name=unattended-upgrades + ansible.builtin.apt: state=absent name=unattended-upgrades - name: autoremove - apt: autoremove=yes purge=yes + ansible.builtin.apt: autoremove=yes purge=yes - name: autoclean - apt: autoclean=yes + ansible.builtin.apt: autoclean=yes when: ansible_os_family == "Debian" diff --git a/roles/common/tasks/system.yml b/roles/common/tasks/system.yml index 2793440..c2057c0 100644 --- a/roles/common/tasks/system.yml +++ b/roles/common/tasks/system.yml @@ -1,11 +1,11 @@ #!/usr/bin/env ansible-playbook # vim:ft=ansible: - name: configure hostname - hostname: name={{ inventory_hostname }} + ansible.builtin.hostname: name={{ inventory_hostname }} - name: ensure loopback name - lineinfile: path=/etc/hosts line="127.0.0.1 {{ inventory_hostname }}" + ansible.builtin.lineinfile: path=/etc/hosts line="127.0.0.1 {{ inventory_hostname }}" - name: configure timezone timezone: name=America/Chicago notify: restart cron - name: configure shell profile - template: src=profile.sh dest=/etc/profile.d/50-ansible.sh mode=0644 + ansible.builtin.template: src=profile.sh dest=/etc/profile.d/50-ansible.sh mode=0644 diff --git a/roles/desktop/handlers/main.yml b/roles/desktop/handlers/main.yml index ee503e0..ef6f8b4 100644 --- a/roles/desktop/handlers/main.yml +++ b/roles/desktop/handlers/main.yml @@ -1,5 +1,5 @@ #!/usr/bin/env ansible-playbook # vim:ft=ansible: - name: regen initramfs - command: /usr/sbin/update-initramfs -c -k all + ansible.builtin.command: /usr/sbin/update-initramfs -c -k all become: yes diff --git a/roles/desktop/tasks/main.yml b/roles/desktop/tasks/main.yml index dd7b1e6..192ad17 100644 --- a/roles/desktop/tasks/main.yml +++ b/roles/desktop/tasks/main.yml @@ -2,9 +2,9 @@ # vim:ft=ansible: --- - name: assure xorg.conf.d - file: path=/etc/X11/xorg.conf.d state=directory mode=0755 + ansible.builtin.file: path=/etc/X11/xorg.conf.d state=directory mode=0755 - name: configure X misc - template: src={{ item }} dest=/etc/X11/xorg.conf.d/{{ item }} mode=0644 + ansible.builtin.template: src={{ item }} dest=/etc/X11/xorg.conf.d/{{ item }} mode=0644 loop: # Disables mouse acceleration on all mouse peripherals - 90-mouse-acceleration.conf diff --git a/roles/desktop/tasks/packages.yml b/roles/desktop/tasks/packages.yml index 79e7c8b..733f6be 100644 --- a/roles/desktop/tasks/packages.yml +++ b/roles/desktop/tasks/packages.yml @@ -5,26 +5,26 @@ block: # Manage archs - name: enable archs - lineinfile: dest=/var/lib/dpkg/arch line={{ item }} create=yes mode=0644 + ansible.builtin.lineinfile: dest=/var/lib/dpkg/arch line={{ item }} create=yes mode=0644 loop: "{{ desktop_apt_archs }}" # Manage keys - name: enroll keys from keyserver - apt_key: keyserver=keyserver.ubuntu.com id={{ item }} + ansible.builtin.apt_key: keyserver=keyserver.ubuntu.com id={{ item }} loop: "{{ desktop_apt_keys_keyserver + desktop_apt_keys_keyserver_extra }}" - name: enroll keys by url - apt_key: url={{ item }} + ansible.builtin.apt_key: url={{ item }} loop: "{{ desktop_apt_keys_url + desktop_apt_keys_url_extra }}" # Manage repos - name: configure repos - apt_repository: repo={{ item }} + ansible.builtin.apt_repository: repo={{ item }} loop: "{{ desktop_apt_repos + desktop_apt_repos_extra }}" # Manage packages - name: configure installed packages - apt: name="{{ desktop_apt_packages + desktop_apt_packages_extra }}" + ansible.builtin.apt: name="{{ desktop_apt_packages + desktop_apt_packages_extra }}" - name: configure removed packages - apt: name="{{ desktop_apt_packages_remove + desktop_apt_packages_remove_extra }}" state=absent + ansible.builtin.apt: name="{{ desktop_apt_packages_remove + desktop_apt_packages_remove_extra }}" state=absent - name: configure out-of-repo packages - apt: deb="{{ item }}" + ansible.builtin.apt: deb="{{ item }}" loop: "{{ desktop_apt_debs + desktop_apt_debs_extra }}" when: ansible_pkg_mgr == "apt" - name: configure portage @@ -35,12 +35,12 @@ synchronize: src="portage/" dest="/etc/portage/" # This is my bootstrap script, which can cause damage if invoked by root again, so we remove it - name: remove gentoostrap - file: path=/gentoostrap.sh state=absent + ansible.builtin.file: path=/gentoostrap.sh state=absent - name: remove gentoostrap package.use - file: path=/etc/portage/package.use/gentoostrap state=absent + ansible.builtin.file: path=/etc/portage/package.use/gentoostrap state=absent when: ansible_os_family == "Gentoo" - name: configure pip3 packages - pip: executable=/usr/bin/pip3 state=latest name="{{ desktop_pip3_packages + desktop_pip3_packages_extra }}" + ansible.builtin.pip: executable=/usr/bin/pip3 state=latest name="{{ desktop_pip3_packages + desktop_pip3_packages_extra }}" when: ansible_os_family != "Gentoo" - name: configure flatpak block: diff --git a/roles/docker-tmodloader13/tasks/main.yml b/roles/docker-tmodloader13/tasks/main.yml index 920f7f4..1a7b8da 100644 --- a/roles/docker-tmodloader13/tasks/main.yml +++ b/roles/docker-tmodloader13/tasks/main.yml @@ -2,7 +2,7 @@ # vim:ft=ansible: --- - name: assure tmodloader {{ tmodloader_name }} directory structure - file: + ansible.builtin.file: state: directory owner: "{{ tmodloader_uid }}" group: "{{ tmodloader_gid }}" @@ -18,30 +18,31 @@ - "{{ tmodloader_data_prefix }}/data/ModLoader/Mods" - "{{ tmodloader_data_prefix }}/data/ModLoader/Worlds" - name: assure mods - shell: + ansible.builtin.shell: cmd: "curl -L \"{{ tmodloader_mod_server }}\" -o \"{{ item }}.tmod\" && chown \"{{ tmodloader_uid }}:{{ tmodloader_gid }}\" \"{{ item }}.tmod\"" chdir: "{{ tmodloader_data_prefix }}/data/ModLoader/Mods" creates: "{{ tmodloader_data_prefix }}/data/ModLoader/Mods/{{ item }}.tmod" with_list: "{{ tmodloader_mods }}" notify: "restart tmodloader {{ tmodloader_name }}" - name: enable mods - template: + ansible.builtin.template: src: enabled.json dest: "{{ tmodloader_data_prefix }}/data/ModLoader/Mods/enabled.json" owner: "{{ tmodloader_uid }}" group: "{{ tmodloader_gid }}" + mode: "0750" notify: "restart tmodloader {{ tmodloader_name }}" - name: assure tmodloader {{ tmodloader_name }} files - file: + ansible.builtin.file: state: touch owner: "{{ tmodloader_uid }}" group: "{{ tmodloader_gid }}" - mode: "0640" + mode: "0750" path: "{{ item }}" with_items: - "{{ tmodloader_data_prefix }}/config.txt" - name: assure {{ tmodloader_name }} configs - lineinfile: + ansible.builtin.lineinfile: state: present regexp: "^{{ item.key }}" line: "{{ item.key }}={{ item.value }}" @@ -49,7 +50,7 @@ with_dict: "{{ tmodloader_config | combine(tmodloader_config_extra) | combine(tmodloader_config_internal) }}" notify: "restart tmodloader {{ tmodloader_name }}" - name: assure {{ tmodloader_name }} backup cronjob - cron: + ansible.builtin.cron: user: root name: "terraria-{{ tmodloader_name }}" minute: "*/30" diff --git a/roles/git/tasks/main.yml b/roles/git/tasks/main.yml index 9fc76d1..9523c2f 100644 --- a/roles/git/tasks/main.yml +++ b/roles/git/tasks/main.yml @@ -2,7 +2,7 @@ # vim:ft=ansible: --- - name: clone git repos - git: + ansible.builtin.git: accept_hostkey: yes depth: "{{ item.depth | default(1, true) }}" dest: "{{ item.dest }}" diff --git a/roles/grub/handlers/main.yml b/roles/grub/handlers/main.yml index e2381ab..b426840 100644 --- a/roles/grub/handlers/main.yml +++ b/roles/grub/handlers/main.yml @@ -1,5 +1,5 @@ #!/usr/bin/env ansible-playbook # vim:ft=ansible: - name: grub mkconfig - command: "grub-mkconfig -o /boot/grub/grub.cfg" + ansible.builtin.command: "grub-mkconfig -o /boot/grub/grub.cfg" become: yes diff --git a/roles/grub/tasks/main.yml b/roles/grub/tasks/main.yml index ad9dbe7..a0285bc 100644 --- a/roles/grub/tasks/main.yml +++ b/roles/grub/tasks/main.yml @@ -4,5 +4,5 @@ - name: configure grub block: - name: template out grub config - template: src=grub.conf dest=/etc/default/grub mode=0644 + ansible.builtin.template: src=grub.conf dest=/etc/default/grub mode=0644 notify: grub mkconfig diff --git a/roles/ingress/tasks/main.yml b/roles/ingress/tasks/main.yml index 9c53e48..ee2f6f4 100644 --- a/roles/ingress/tasks/main.yml +++ b/roles/ingress/tasks/main.yml @@ -1,12 +1,12 @@ #!/usr/bin/env ansible-playbook # vim:ft=ansible: - name: assure ingress container persist directories - file: path="{{ ingress_container_persist_dir }}/{{ item }}" state=directory owner=root mode=0755 + ansible.builtin.file: path="{{ ingress_container_persist_dir }}/{{ item }}" state=directory owner=root mode=0755 with_items: - letsencrypt - user_conf.d - name: template out ingress configuration file - template: src=vhosts.conf.j2 dest="{{ ingress_container_persist_dir }}/user_conf.d/vhosts.conf" mode="0640" + ansible.builtin.template: src=vhosts.conf.j2 dest="{{ ingress_container_persist_dir }}/user_conf.d/vhosts.conf" mode="0640" notify: restart ingress container - name: assure ingress container docker_container: diff --git a/roles/motd/tasks/main.yml b/roles/motd/tasks/main.yml index ed74027..4a650ce 100644 --- a/roles/motd/tasks/main.yml +++ b/roles/motd/tasks/main.yml @@ -1,11 +1,11 @@ #!/usr/bin/env ansible-playbook # vim:ft=ansible: - name: remove default motd items - file: state=absent path=/etc/update-motd.d/{{ item }} + ansible.builtin.file: state=absent path=/etc/update-motd.d/{{ item }} loop: "{{ motd_remove + motd_remove_extra }}" - name: disable motd-news - systemd: name="{{ item }}" state=stopped enabled=no + ansible.builtin.systemd: name="{{ item }}" state=stopped enabled=no with_items: - motd-news.timer - name: template out motd script - template: src=motd.sh dest=/etc/update-motd.d/50-ansible mode=0755 + ansible.builtin.template: src=motd.sh dest=/etc/update-motd.d/50-ansible mode=0755 diff --git a/roles/nagios/tasks/main.yml b/roles/nagios/tasks/main.yml index da39ebc..8fdb3a1 100644 --- a/roles/nagios/tasks/main.yml +++ b/roles/nagios/tasks/main.yml @@ -1,6 +1,6 @@ # vim:ft=ansible: - name: assure data directory for nagios - file: path="{{ nagios_data_dir }}" state=directory mode=0755 + ansible.builtin.file: path="{{ nagios_data_dir }}" state=directory mode=0755 tags: [ nagios ] - name: docker deploy nagios docker_container: @@ -27,15 +27,15 @@ - /dev/null:/opt/nagios/bin/send_nsca tags: [ docker, nagios ] - name: template out scripts for nagios - template: src="{{ item }}" dest="{{ nagios_data_dir }}/plugins/{{ item }}" owner=root group=root mode=0755 + ansible.builtin.template: src="{{ item }}" dest="{{ nagios_data_dir }}/plugins/{{ item }}" owner=root group=root mode=0755 with_items: - notify-by-matrix tags: [ nagios, template, plugins ] - name: template out config for nagios - template: src=nagios-ansible-inventory.cfg.j2 dest="{{ nagios_data_dir }}/etc/objects/ansible.cfg" owner=101 group=100 mode=0644 + ansible.builtin.template: src=nagios-ansible-inventory.cfg.j2 dest="{{ nagios_data_dir }}/etc/objects/ansible.cfg" owner=101 group=100 mode=0644 tags: [ nagios, template ] notify: restart nagios - name: assure config file is loaded - lineinfile: path="{{ nagios_data_dir }}/etc/nagios.cfg" line='cfg_file=/opt/nagios/etc/objects/ansible.cfg' + ansible.builtin.lineinfile: path="{{ nagios_data_dir }}/etc/nagios.cfg" line='cfg_file=/opt/nagios/etc/objects/ansible.cfg' tags: [ nagios, template ] notify: restart nagios diff --git a/roles/pulseaudio/tasks/main.yml b/roles/pulseaudio/tasks/main.yml index 4fcc1af..2427c1b 100644 --- a/roles/pulseaudio/tasks/main.yml +++ b/roles/pulseaudio/tasks/main.yml @@ -1,21 +1,21 @@ #!/usr/bin/env ansible-playbook # vim:ft=ansible: - name: assure pulse package - apt: name=pulseaudio + ansible.builtin.apt: name=pulseaudio when: ansible_os_family == 'Debian' - name: remove user pulseaudio services - file: state=absent path={{ item }} + ansible.builtin.file: state=absent path={{ item }} loop: - /etc/systemd/user/default.target.wants/pulseaudio.service - /etc/systemd/user/sockets.target.wants/pulseaudio.socket - name: template out configs - template: src={{ item.src }} dest={{ item.dest }} mode=0644 + ansible.builtin.template: src={{ item.src }} dest={{ item.dest }} mode=0644 loop: - { src: "pulse-client.conf", dest: "/etc/pulse/client.conf" } - { src: "pulse-daemon.conf", dest: "/etc/pulse/daemon.conf" } - { src: "pulse-default.pa", dest: "/etc/pulse/default.pa" } - { src: "pulseaudio.service", dest: "/etc/systemd/system/pulseaudio.service" } - name: assure pulse user - user: name=pulseaudio password="!" system=yes home=/var/lib/pulse groups=audio + ansible.builtin.user: name=pulseaudio password="!" system=yes home=/var/lib/pulse groups=audio - name: enable pulse service - systemd: name=pulseaudio enabled=yes state=started daemon_reload=yes + ansible.builtin.systemd: name=pulseaudio enabled=yes state=started daemon_reload=yes diff --git a/roles/udev/handlers/main.yml b/roles/udev/handlers/main.yml index 100127d..4e16995 100644 --- a/roles/udev/handlers/main.yml +++ b/roles/udev/handlers/main.yml @@ -1,5 +1,5 @@ #!/usr/bin/env ansible-playbook # vim:ft=ansible: - name: reload udev - command: udevadm trigger + ansible.builtin.command: udevadm trigger become: yes diff --git a/roles/udev/tasks/main.yml b/roles/udev/tasks/main.yml index 7ee92d0..a755f01 100644 --- a/roles/udev/tasks/main.yml +++ b/roles/udev/tasks/main.yml @@ -2,6 +2,6 @@ # vim:ft=ansible: --- - name: configure udev rules - lineinfile: path=/etc/udev/rules.d/50-ansible.rules line={{ item }} create=yes mode=0644 + ansible.builtin.lineinfile: path=/etc/udev/rules.d/50-ansible.rules line={{ item }} create=yes mode=0644 loop: "{{ udev_rules }}" notify: reload udev diff --git a/roles/zerotier/handlers/main.yml b/roles/zerotier/handlers/main.yml index 4b015ef..e42a3b7 100644 --- a/roles/zerotier/handlers/main.yml +++ b/roles/zerotier/handlers/main.yml @@ -2,7 +2,7 @@ # vim:ft=ansible: --- - name: restart zerotier - systemd: + ansible.builtin.systemd: daemon_reload: yes name: zerotier-one.service state: restarted diff --git a/roles/zerotier/tasks/main.yml b/roles/zerotier/tasks/main.yml index c470cd6..1b16e71 100644 --- a/roles/zerotier/tasks/main.yml +++ b/roles/zerotier/tasks/main.yml @@ -4,24 +4,24 @@ - name: configure zerotier for apt block: - name: ensure zerotier repo key - apt_key: url="{{ zerotier_repo_deb_key }}" + ansible.builtin.apt_key: url="{{ zerotier_repo_deb_key }}" - name: ensure zerotier repo - apt_repository: repo="{{ zerotier_repo_deb }}" + ansible.builtin.apt_repository: repo="{{ zerotier_repo_deb }}" - name: update apt cache - apt: update_cache=yes cache_valid_time=86400 + ansible.builtin.apt: update_cache=yes cache_valid_time=86400 - name: ensure packages - apt: name=zerotier-one + ansible.builtin.apt: name=zerotier-one when: ansible_pkg_mgr == "apt" - name: template unit file - template: src=zerotier-one.service dest=/etc/systemd/system/zerotier-one.service mode=0644 + ansible.builtin.template: src=zerotier-one.service dest=/etc/systemd/system/zerotier-one.service mode=0644 notify: restart zerotier - name: join networks - command: + ansible.builtin.command: argv: [ zerotier-cli, join, "{{ item }}" ] with_items: "{{ zerotier_networks_join }}" changed_when: no - name: leave networks - command: + ansible.builtin.command: argv: [ zerotier-cli, leave, "{{ item }}" ] register: zerotierleave with_items: "{{ zerotier_networks_leave }}"