diff --git a/ansible/configuration/fail2ban/config-f2b-protect-sshd.yaml b/ansible/configuration/fail2ban/config-f2b-protect-sshd.yaml index 529f945..8d87328 100644 --- a/ansible/configuration/fail2ban/config-f2b-protect-sshd.yaml +++ b/ansible/configuration/fail2ban/config-f2b-protect-sshd.yaml @@ -3,17 +3,17 @@ hosts: "{{ my_hosts | d([]) }}" become: yes tasks: - - name: install fail2ban - ansible.builtin.apt: - name: - - fail2ban - update_cache: yes - - name: copy fail2ban configfiles - ansible.builtin.copy: - src: configfiles/debian-sshd-default.conf - dest: /etc/fail2ban/jail.d/debian-sshd-default.conf - - name: restart fail2ban - ansible.builtin.systemd_service: - state: restarted - daemon_reload: yes - name: fail2ban + - name: install fail2ban + ansible.builtin.apt: + name: + - fail2ban + update_cache: yes + - name: copy fail2ban configfiles + ansible.builtin.copy: + src: configfiles/debian-sshd-default.conf + dest: /etc/fail2ban/jail.d/debian-sshd-default.conf + - name: restart fail2ban + ansible.builtin.systemd_service: + state: restarted + daemon_reload: yes + name: fail2ban diff --git a/ansible/configuration/ssh/config-add-sshkey.yaml b/ansible/configuration/ssh/config-add-sshkey.yaml index 3e19461..a512584 100644 --- a/ansible/configuration/ssh/config-add-sshkey.yaml +++ b/ansible/configuration/ssh/config-add-sshkey.yaml @@ -3,15 +3,15 @@ hosts: "{{ my_hosts | d([]) }}" become: yes tasks: - - name: install public keys - ansible.posix.authorized_key: - user: "{{ lookup('env','USER') }}" - state: present - key: "{{ lookup('file', '~/.ssh/id_rsa.pub') }}" - - name: change sudoers file - ansible.builtin.lineinfile: - path: /etc/sudoers - state: present - regexp: '^%sudo' - line: '%sudo ALL=(ALL) NOPASSWD: ALL' - validate: /usr/sbin/visudo -cf %s + - name: install public keys + ansible.posix.authorized_key: + user: "{{ lookup('env','USER') }}" + state: present + key: "{{ lookup('file', '~/.ssh/id_rsa.pub') }}" + - name: change sudoers file + ansible.builtin.lineinfile: + path: /etc/sudoers + state: present + regexp: '^%sudo' + line: '%sudo ALL=(ALL) NOPASSWD: ALL' + validate: /usr/sbin/visudo -cf %s diff --git a/ansible/deployment/portainer/deploy-portainer.yaml b/ansible/deployment/portainer/deploy-portainer.yaml index 6cb288d..e9ff94f 100644 --- a/ansible/deployment/portainer/deploy-portainer.yaml +++ b/ansible/deployment/portainer/deploy-portainer.yaml @@ -4,16 +4,16 @@ become: yes become_user: "{{ lookup('env','USER') }}" tasks: - - name: create new volume - community.docker.docker_volume: - name: portainer-data - - name: deploy portainer - community.docker.docker_container: - name: portainer - image: "docker.io/portainer/portainer-ce" - ports: - - "9443:9443" - volumes: - - /var/run/docker.sock:/var/run/docker.sock - - portainer-data:/data - restart_policy: unless-stopped + - name: create new volume + community.docker.docker_volume: + name: portainer-data + - name: deploy portainer + community.docker.docker_container: + name: portainer + image: "docker.io/portainer/portainer-ce" + ports: + - "9443:9443" + volumes: + - /var/run/docker.sock:/var/run/docker.sock + - portainer-data:/data + restart_policy: unless-stopped diff --git a/ansible/deployment/traefik/deploy-traefik.yaml b/ansible/deployment/traefik/deploy-traefik.yaml index 042baf2..75ba208 100644 --- a/ansible/deployment/traefik/deploy-traefik.yaml +++ b/ansible/deployment/traefik/deploy-traefik.yaml @@ -3,15 +3,15 @@ hosts: "{{ my_hosts | d([]) }}" become: yes tasks: - - name: deploy traefik - become_user: "{{ lookup('env','USER') }}" - community.docker.docker_container: - name: traefik - image: "traefik:v2.5" - ports: - - "80:80" - - "443:443" - volumes: - - /var/run/docker.sock:/var/run/docker.sock - - /etc/traefik:/etc/traefik - restart_policy: unless-stopped + - name: deploy traefik + become_user: "{{ lookup('env','USER') }}" + community.docker.docker_container: + name: traefik + image: "traefik:v2.5" + ports: + - "80:80" + - "443:443" + volumes: + - /var/run/docker.sock:/var/run/docker.sock + - /etc/traefik:/etc/traefik + restart_policy: unless-stopped diff --git a/ansible/installation/inst-core.yaml b/ansible/installation/inst-core.yaml index 2a2acf1..c4fb1a2 100644 --- a/ansible/installation/inst-core.yaml +++ b/ansible/installation/inst-core.yaml @@ -3,9 +3,9 @@ hosts: "{{ my_hosts | d([]) }}" become: yes tasks: - - name: install core packages - ansible.builtin.apt: - name: - - prometheus-node-exporter - - nfs-common - update_cache: yes + - name: install core packages + ansible.builtin.apt: + name: + - prometheus-node-exporter + - nfs-common + update_cache: yes diff --git a/ansible/installation/inst-vm-core.yaml b/ansible/installation/inst-vm-core.yaml index 87cb698..5c9b250 100644 --- a/ansible/installation/inst-vm-core.yaml +++ b/ansible/installation/inst-vm-core.yaml @@ -3,15 +3,15 @@ hosts: "{{ my_hosts | d([]) }}" become: yes tasks: - - name: install packages - ansible.builtin.apt: - name: - - prometheus-node-exporter - - nfs-common - - qemu-guest-agent - update_cache: yes - - name: start guest qemu-guest-agent - ansible.builtin.service: - name: qemu-guest-agent - state: started - enabled: yes + - name: install packages + ansible.builtin.apt: + name: + - prometheus-node-exporter + - nfs-common + - qemu-guest-agent + update_cache: yes + - name: start guest qemu-guest-agent + ansible.builtin.service: + name: qemu-guest-agent + state: started + enabled: yes diff --git a/ansible/maintenance/maint-reboot.yaml b/ansible/maintenance/maint-reboot.yaml index 5748a5b..8c496b3 100644 --- a/ansible/maintenance/maint-reboot.yaml +++ b/ansible/maintenance/maint-reboot.yaml @@ -3,6 +3,6 @@ hosts: "{{ my_hosts | d([]) }}" become: yes tasks: - - name: reboot machine - ansible.builtin.reboot: - reboot_timeout: 3600 + - name: reboot machine + ansible.builtin.reboot: + reboot_timeout: 3600 diff --git a/vagrant/hyperv/ubuntu/microk8s-installed/playbook.yaml b/vagrant/hyperv/ubuntu/microk8s-installed/playbook.yaml index 0c050c6..807e3e9 100644 --- a/vagrant/hyperv/ubuntu/microk8s-installed/playbook.yaml +++ b/vagrant/hyperv/ubuntu/microk8s-installed/playbook.yaml @@ -2,10 +2,10 @@ - hosts: all become: yes tasks: - - name: install microk8s - community.general.snap: - classic: yes - name: microk8s - - name: add userpermissions - ansible.builtin.shell: "usermod -aG microk8s vagrant" + - name: install microk8s + community.general.snap: + classic: yes + name: microk8s + - name: add userpermissions + ansible.builtin.shell: "usermod -aG microk8s vagrant" diff --git a/vagrant/hyperv/ubuntu/plain-with-cockpit/playbook.yaml b/vagrant/hyperv/ubuntu/plain-with-cockpit/playbook.yaml index 993f17e..d411c5b 100755 --- a/vagrant/hyperv/ubuntu/plain-with-cockpit/playbook.yaml +++ b/vagrant/hyperv/ubuntu/plain-with-cockpit/playbook.yaml @@ -2,7 +2,7 @@ - hosts: all become: yes tasks: - - name: install cockpit - ansible.builtin.apt: - name: cockpit - update_cache: yes + - name: install cockpit + ansible.builtin.apt: + name: cockpit + update_cache: yes