fix: consistently use true/false as truthy values

This commit is contained in:
Christoph Schug 2024-03-03 16:16:22 +01:00
parent 706ac210f7
commit 6e52db9cf6
16 changed files with 29 additions and 29 deletions

View File

@ -1,13 +1,13 @@
---
- name: install fail2ban and configure sshd
hosts: "{{ my_hosts | d([]) }}"
become: yes
become: true
tasks:
- name: install fail2ban
ansible.builtin.apt:
name:
- fail2ban
update_cache: yes
update_cache: true
- name: copy fail2ban configfiles
ansible.builtin.copy:
src: configfiles/debian-sshd-default.conf
@ -15,5 +15,5 @@
- name: restart fail2ban
ansible.builtin.systemd_service:
state: restarted
daemon_reload: yes
daemon_reload: true
name: fail2ban

View File

@ -1,7 +1,7 @@
---
- name: add ssh key
hosts: "{{ my_hosts | d([]) }}"
become: yes
become: true
tasks:
- name: install public keys
ansible.posix.authorized_key:

View File

@ -1,7 +1,7 @@
---
- name: deploy portainer-ce latest
hosts: "{{ my_hosts | d([]) }}"
become: yes
become: true
become_user: "{{ lookup('env','USER') }}"
tasks:
- name: create new volume

View File

@ -1,7 +1,7 @@
---
- name: deploy traefik v2.5
hosts: "{{ my_hosts | d([]) }}"
become: yes
become: true
tasks:
- name: deploy traefik
become_user: "{{ lookup('env','USER') }}"

View File

@ -1,11 +1,11 @@
---
- name: install core packages
hosts: "{{ my_hosts | d([]) }}"
become: yes
become: true
tasks:
- name: install core packages
ansible.builtin.apt:
name:
- prometheus-node-exporter
- nfs-common
update_cache: yes
update_cache: true

View File

@ -1,7 +1,7 @@
---
- name: install docker
hosts: "{{ my_hosts | d([]) }}"
become: yes
become: true
tasks:
- name: install docker dependencies
ansible.builtin.apt:
@ -11,7 +11,7 @@
- curl
- gnupg-agent
- software-properties-common
update_cache: yes
update_cache: true
- name: add docker gpg key
ansible.builtin.apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
@ -31,4 +31,4 @@
- docker-buildx-plugin
- docker-scan-plugin
- docker-compose-plugin
update_cache: yes
update_cache: true

View File

@ -1,11 +1,11 @@
---
- name: install microk8s
hosts: "{{ my_hosts | d([]) }}"
become: yes
become: true
tasks:
- name: install microk8s
community.general.snap:
classic: yes
classic: true
name: microk8s
- name: add userpermissions
ansible.builtin.shell: "usermod -aG microk8s {{ lookup('env','USER') }}"

View File

@ -1,7 +1,7 @@
---
- name: install core packages for virtual machines
hosts: "{{ my_hosts | d([]) }}"
become: yes
become: true
tasks:
- name: install packages
ansible.builtin.apt:
@ -9,9 +9,9 @@
- prometheus-node-exporter
- nfs-common
- qemu-guest-agent
update_cache: yes
update_cache: true
- name: start guest qemu-guest-agent
ansible.builtin.service:
name: qemu-guest-agent
state: started
enabled: yes
enabled: true

View File

@ -1,12 +1,12 @@
---
- name: install wireguard
hosts: "{{ my_hosts | d([]) }}"
become: yes
become: true
tasks:
- name: install wireguard
ansible.builtin.apt:
name: wireguard
update_cache: yes
update_cache: true
- name: generate private and public keypair
ansible.builtin.shell: |
wg genkey | tee privatekey | wg pubkey > publickey

View File

@ -1,7 +1,7 @@
---
- name: install zsh
hosts: "{{ my_hosts | d([]) }}"
become: yes
become: true
tasks:
- name: install zsh
ansible.builtin.apt:

View File

@ -1,7 +1,7 @@
---
- name: check if system reboot is required
hosts: "{{ my_hosts | d([]) }}"
become: yes
become: true
tasks:
- name: check if system reboot is required
become: true

View File

@ -1,7 +1,7 @@
---
- name: reboot machine
hosts: "{{ my_hosts | d([]) }}"
become: yes
become: true
tasks:
- name: reboot machine
ansible.builtin.reboot:

View File

@ -5,7 +5,7 @@
- name: Update packages with apt
when: ansible_pkg_mgr == 'apt'
ansible.builtin.apt:
update_cache: yes
update_cache: true
- name: Update packages with yum
when: ansible_pkg_mgr == 'yum'

View File

@ -1,6 +1,6 @@
---
- hosts: all
become: yes
become: true
tasks:
- name: install prerequisites
ansible.builtin.apt:
@ -10,7 +10,7 @@
- curl
- gnupg-agent
- software-properties-common
update_cache: yes
update_cache: true
- name: add apt-key
ansible.builtin.apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
@ -24,6 +24,6 @@
- docker-ce-cli
- containerd.io
- docker-compose
update_cache: yes
update_cache: true
- name: add userpermissions
ansible.builtin.shell: "usermod -aG docker vagrant"

View File

@ -1,10 +1,10 @@
---
- hosts: all
become: yes
become: true
tasks:
- name: install microk8s
community.general.snap:
classic: yes
classic: true
name: microk8s
- name: add userpermissions
ansible.builtin.shell: "usermod -aG microk8s vagrant"

View File

@ -1,8 +1,8 @@
---
- hosts: all
become: yes
become: true
tasks:
- name: install cockpit
ansible.builtin.apt:
name: cockpit
update_cache: yes
update_cache: true