Skip to content
Snippets Groups Projects
Commit 17d03554 authored by nimrod's avatar nimrod
Browse files

Update ansible-lint.

Address a great bunch of warnings.
parent ca7c7587
Branches
No related tags found
No related merge requests found
Showing
with 112 additions and 110 deletions
...@@ -72,7 +72,7 @@ repos: ...@@ -72,7 +72,7 @@ repos:
- id: shellcheck - id: shellcheck
- repo: https://github.com/ansible/ansible-lint.git - repo: https://github.com/ansible/ansible-lint.git
rev: v5.2.1 rev: v6.0.2
hooks: hooks:
- id: ansible-lint - id: ansible-lint
......
--- ---
- name: Update APT sources - name: Update APT sources
raw: apt-get update ansible.builtin.raw: apt-get update
changed_when: false changed_when: false
- name: APT install Python - name: APT install Python
raw: DEBIAN_FRONTEND=noninteractive apt-get install -qy python3 ansible.builtin.raw: |-
DEBIAN_FRONTEND=noninteractive apt-get install -qy python3
register: debian_bootstrap_install_python3 register: debian_bootstrap_install_python3
changed_when: "'Unpacking' in debian_bootstrap_install_python3.stdout" changed_when: "'Unpacking' in debian_bootstrap_install_python3.stdout"
- name: Install requirements for more complete facts - name: Install requirements for more complete facts
apt: ansible.builtin.apt:
name: name:
- iproute2 - iproute2
- lsb-release - lsb-release
...@@ -18,4 +19,4 @@ ...@@ -18,4 +19,4 @@
cache_valid_time: 3600 cache_valid_time: 3600
- name: Gather facts - name: Gather facts
setup: ansible.builtin.setup:
...@@ -4,19 +4,19 @@ ...@@ -4,19 +4,19 @@
daemon_reload: true daemon_reload: true
- name: Rebuild initramfs - name: Rebuild initramfs
command: ansible.builtin.command:
cmd: update-initramfs -u cmd: update-initramfs -u
- name: Update GRUB - name: Update GRUB
command: ansible.builtin.command:
cmd: update-grub cmd: update-grub
- name: Restart the SSH daemon - name: Restart the SSH daemon
service: ansible.builtin.service:
name: ssh name: ssh
state: restarted state: restarted
- name: Restart Docker - name: Restart Docker
service: ansible.builtin.service:
name: docker name: docker
state: restarted state: restarted
--- ---
- name: Install btrfs packages - name: Install btrfs packages
apt: ansible.builtin.apt:
cache_valid_time: 3600 cache_valid_time: 3600
name: name:
- btrfs-progs - btrfs-progs
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
state: present state: present
- name: Copy btrfs backup script - name: Copy btrfs backup script
copy: ansible.builtin.copy:
dest: /usr/local/sbin/btrfs-backup dest: /usr/local/sbin/btrfs-backup
group: root group: root
mode: preserve mode: preserve
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
- name: Disable cgroup2 for Docker - name: Disable cgroup2 for Docker
# yamllint disable-line rule:line-length # yamllint disable-line rule:line-length
when: ansible_facts.packages['docker.io'][0]["version"] is version('20.10', operator='<=') when: ansible_facts.packages['docker.io'][0]["version"] is version('20.10', operator='<=')
lineinfile: ansible.builtin.lineinfile:
backup: true backup: true
line: |- line: |-
GRUB_CMDLINE_LINUX_DEFAULT="quiet systemd.unified_cgroup_hierarchy=0" GRUB_CMDLINE_LINUX_DEFAULT="quiet systemd.unified_cgroup_hierarchy=0"
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
- Update GRUB - Update GRUB
- name: Copy the script to start stopped container after a restart - name: Copy the script to start stopped container after a restart
copy: ansible.builtin.copy:
dest: /usr/share/docker.io/restart-containers dest: /usr/share/docker.io/restart-containers
mode: preserve mode: preserve
src: docker-restart src: docker-restart
...@@ -23,13 +23,13 @@ ...@@ -23,13 +23,13 @@
loop: loop:
- service - service
- socket - socket
file: ansible.builtin.file:
path: /etc/systemd/system/docker.{{ item }}.d path: /etc/systemd/system/docker.{{ item }}.d
mode: 0o0755 mode: 0o0755
state: directory state: directory
- name: Restart stopped containers after a restart - name: Restart stopped containers after a restart
copy: ansible.builtin.copy:
content: | content: |
[Service] [Service]
ExecStartPost=/usr/share/docker.io/restart-containers ExecStartPost=/usr/share/docker.io/restart-containers
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
- Systemd daemon reload - Systemd daemon reload
- name: Allow access from the toolbox container - name: Allow access from the toolbox container
copy: ansible.builtin.copy:
content: | content: |
[Socket] [Socket]
SocketGroup=nimrod SocketGroup=nimrod
......
--- ---
- name: Verify assertions - name: Verify assertions
assert: ansible.builtin.assert:
that: that:
- ansible_facts.distribution == "Debian" - ansible_facts.distribution == "Debian"
- ansible_facts.distribution_major_version|int >= 10 - ansible_facts.distribution_major_version|int >= 10
...@@ -10,14 +10,14 @@ ...@@ -10,14 +10,14 @@
loop: loop:
- deb - deb
- deb-src - deb-src
apt_repository: ansible.builtin.apt_repository:
# yamllint disable-line rule:line-length # yamllint disable-line rule:line-length
repo: '{{ item }} http://deb.debian.org/debian {{ ansible_facts.distribution_release }}-backports main contrib non-free' repo: '{{ item }} http://deb.debian.org/debian {{ ansible_facts.distribution_release }}-backports main contrib non-free'
state: present state: present
update_cache: true update_cache: true
- name: Set normal priority for the backports repo - name: Set normal priority for the backports repo
copy: ansible.builtin.copy:
content: | content: |
Package: * Package: *
Pin: release o=Debian Backports Pin: release o=Debian Backports
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
owner: root owner: root
- name: Install packages - name: Install packages
apt: ansible.builtin.apt:
cache_valid_time: 3600 cache_valid_time: 3600
name: name:
- amd64-microcode - amd64-microcode
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
state: present state: present
- name: Disable swap - name: Disable swap
lineinfile: ansible.builtin.lineinfile:
backup: true backup: true
path: /etc/fstab path: /etc/fstab
regexp: swap regexp: swap
......
../../../../tasks/sshd_config.yaml
\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
loop: loop:
- /etc/subgid - /etc/subgid
- /etc/subuid - /etc/subuid
copy: ansible.builtin.copy:
content: | content: |
nimrod:100000:65536 nimrod:100000:65536
dest: |- dest: |-
...@@ -24,13 +24,13 @@ ...@@ -24,13 +24,13 @@
when: ansible_facts.distribution_release in toolbox_podman_repo_base_url_mapping when: ansible_facts.distribution_release in toolbox_podman_repo_base_url_mapping
block: block:
- name: Add the Podman repo key - name: Add the Podman repo key
apt_key: ansible.builtin.apt_key:
state: present state: present
url: |- url: |-
{{ toolbox_podman_repo_base_url }}/Release.key {{ toolbox_podman_repo_base_url }}/Release.key
- name: Add the Podman repo - name: Add the Podman repo
apt_repository: ansible.builtin.apt_repository:
repo: |- repo: |-
deb {{ toolbox_podman_repo_base_url }} / deb {{ toolbox_podman_repo_base_url }} /
state: present state: present
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
- name: Install newer libseccomp2 from the backports repository - name: Install newer libseccomp2 from the backports repository
when: ansible_facts.distribution_release == "buster" when: ansible_facts.distribution_release == "buster"
apt: ansible.builtin.apt:
cache_valid_time: 3600 cache_valid_time: 3600
default_release: buster-backports default_release: buster-backports
name: name:
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
update_cache: true update_cache: true
- name: APT install prerequisites - name: APT install prerequisites
apt: ansible.builtin.apt:
cache_valid_time: 3600 cache_valid_time: 3600
install_recommends: false install_recommends: false
name: name:
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
- name: Install Toolbx from toolbox-build - name: Install Toolbx from toolbox-build
# yamllint disable-line rule:line-length # yamllint disable-line rule:line-length
when: ansible_facts.distribution_release is in toolbox_distros_without_apt_package when: ansible_facts.distribution_release is in toolbox_distros_without_apt_package
unarchive: ansible.builtin.unarchive:
dest: /usr/local/ dest: /usr/local/
remote_src: true remote_src: true
# yamllint disable-line rule:line-length # yamllint disable-line rule:line-length
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
- name: APT install Toolbx - name: APT install Toolbx
# yamllint disable-line rule:line-length # yamllint disable-line rule:line-length
when: ansible_facts.distribution_release is not in toolbox_distros_without_apt_package when: ansible_facts.distribution_release is not in toolbox_distros_without_apt_package
apt: ansible.builtin.apt:
cache_valid_time: 3600 cache_valid_time: 3600
name: name:
- podman-toolbox - podman-toolbox
......
--- ---
- name: Create my www directory - name: Create my www directory
file: ansible.builtin.file:
group: www-data group: www-data
mode: 0o0755 mode: 0o0755
owner: www-data owner: www-data
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
state: directory state: directory
- name: Create an SSL directory under /var - name: Create an SSL directory under /var
file: ansible.builtin.file:
group: root group: root
mode: 0o0755 mode: 0o0755
owner: root owner: root
...@@ -22,18 +22,18 @@ ...@@ -22,18 +22,18 @@
# valid) certificate, don't overwrite it. # valid) certificate, don't overwrite it.
- name: Create private SSL key - name: Create private SSL key
command: ansible.builtin.command:
cmd: openssl genrsa -out /var/ssl/site.key 4096 cmd: openssl genrsa -out /var/ssl/site.key 4096
creates: /var/ssl/site.key creates: /var/ssl/site.key
- name: Make sure the private key is accessible - name: Make sure the private key is accessible
file: ansible.builtin.file:
mode: 0o0444 mode: 0o0444
path: /var/ssl/site.key path: /var/ssl/site.key
state: file state: file
- name: Create SSL certificate - name: Create SSL certificate
command: ansible.builtin.command:
cmd: >- cmd: >-
openssl openssl
req req
......
--- ---
- name: Restart Xorg - name: Restart Xorg
service: ansible.builtin.service:
name: xorg.service name: xorg.service
state: restarted state: restarted
- name: Restart Kodi - name: Restart Kodi
service: ansible.builtin.service:
name: kodi.service name: kodi.service
state: restarted state: restarted
--- ---
- name: APT install - name: APT install
apt: ansible.builtin.apt:
cache_valid_time: 3600 cache_valid_time: 3600
install_recommends: false install_recommends: false
name: name:
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
update_cache: true update_cache: true
- name: Configure boot splash - name: Configure boot splash
copy: ansible.builtin.copy:
backup: true backup: true
content: | content: |
[Daemon] [Daemon]
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
- Rebuild initramfs - Rebuild initramfs
- name: Enable boot splash - name: Enable boot splash
lineinfile: ansible.builtin.lineinfile:
backup: true backup: true
# yamllint disable-line rule:line-length # yamllint disable-line rule:line-length
line: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash systemd.unified_cgroup_hierarchy=0" line: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash systemd.unified_cgroup_hierarchy=0"
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
- Update GRUB - Update GRUB
- name: Create library mountpoint - name: Create library mountpoint
file: ansible.builtin.file:
mode: 0o0755 mode: 0o0755
path: /srv/library path: /srv/library
state: directory state: directory
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
- transmission - transmission
loop_control: loop_control:
index_var: idx index_var: idx
user: ansible.builtin.user:
create_home: true create_home: true
home: /var/lib/{{ item }} home: /var/lib/{{ item }}
name: '{{ item }}' name: '{{ item }}'
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
- Restart Kodi - Restart Kodi
- name: Configure rootless Xorg - name: Configure rootless Xorg
copy: ansible.builtin.copy:
backup: true backup: true
content: | content: |
allowed_users=anybody allowed_users=anybody
...@@ -103,7 +103,7 @@ ...@@ -103,7 +103,7 @@
with_items: &services with_items: &services
- xorg.service - xorg.service
- kodi.service - kodi.service
copy: ansible.builtin.copy:
dest: /etc/systemd/system/ dest: /etc/systemd/system/
mode: preserve mode: preserve
src: '{{ item }}' src: '{{ item }}'
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
- name: Enable services - name: Enable services
with_items: *services with_items: *services
service: ansible.builtin.service:
daemon-reload: true daemon-reload: true
enabled: true enabled: true
name: '{{ item }}' name: '{{ item }}'
......
--- ---
- name: Install Python3 - name: Install Python3
raw: pkg_add -Iz py3-pip ansible.builtin.raw: pkg_add -Iz py3-pip
register: openbsd_pkg_add_python register: openbsd_pkg_add_python
failed_when: "'error' in openbsd_pkg_add_python.stdout|lower" failed_when: "'error' in openbsd_pkg_add_python.stdout|lower"
changed_when: "'extracting' in openbsd_pkg_add_python.stdout" changed_when: "'extracting' in openbsd_pkg_add_python.stdout"
- name: Gather facts - name: Gather facts
setup: ansible.builtin.setup:
- name: Configure doas - name: Configure doas
copy: ansible.builtin.copy:
content: | content: |
permit nopass keepenv root permit nopass keepenv root
permit nopass keepenv nimrod permit nopass keepenv nimrod
......
--- ---
- name: Install Python3 - name: Install Python3
raw: opkg install python3 ansible.builtin.raw: opkg install python3
register: opkg_install_python3 register: opkg_install_python3
changed_when: | changed_when: |
'installing' in opkg_install_python3.stdout 'installing' in opkg_install_python3.stdout
- name: Gather facts - name: Gather facts
setup: ansible.builtin.setup:
--- ---
- name: Setup network interfaces - name: Setup network interfaces
command: ansible.builtin.command:
cmd: /bin/sh /etc/netstart cmd: /bin/sh /etc/netstart
- name: Reload PF - name: Reload PF
command: ansible.builtin.command:
cmd: pfctl -f /etc/pf.conf cmd: pfctl -f /etc/pf.conf
- name: Rebuild mail aliases - name: Rebuild mail aliases
command: ansible.builtin.command:
cmd: newaliases cmd: newaliases
- name: Restart HAProxy - name: Restart HAProxy
service: ansible.builtin.service:
name: haproxy name: haproxy
state: restarted state: restarted
- name: Restart NSD - name: Restart NSD
service: ansible.builtin.service:
name: nsd name: nsd
state: restarted state: restarted
- name: Restart Unbound - name: Restart Unbound
service: ansible.builtin.service:
name: unbound name: unbound
state: restarted state: restarted
- name: Restart the FTP proxy - name: Restart the FTP proxy
service: ansible.builtin.service:
name: ftpproxy name: ftpproxy
state: restarted state: restarted
- name: Restart the DHCP daemon - name: Restart the DHCP daemon
service: ansible.builtin.service:
name: dhcpd name: dhcpd
state: restarted state: restarted
- name: Restart the SMTP daemon - name: Restart the SMTP daemon
service: ansible.builtin.service:
name: smtpd name: smtpd
state: restarted state: restarted
- name: Restart the spam deferral daemon - name: Restart the spam deferral daemon
service: ansible.builtin.service:
name: spamd name: spamd
state: restarted state: restarted
- name: Restart the BGP daemon - name: Restart the BGP daemon
service: ansible.builtin.service:
name: bgpd name: bgpd
state: restarted state: restarted
- name: Restart the NTP daemon - name: Restart the NTP daemon
service: ansible.builtin.service:
name: ntpd name: ntpd
state: restarted state: restarted
- name: Restart the HTTP daemon - name: Restart the HTTP daemon
service: ansible.builtin.service:
name: httpd name: httpd
state: restarted state: restarted
- name: Message about restarting the machine - name: Message about restarting the machine
debug: ansible.builtin.debug:
msg: The {{ ansible_facts.hostname }} needs to be restarted msg: The {{ ansible_facts.hostname }} needs to be restarted
verbosity: 0 verbosity: 0
- name: Stop the audio server - name: Stop the audio server
service: ansible.builtin.service:
name: sndiod name: sndiod
state: stopped state: stopped
- name: Restart the SSH daemon - name: Restart the SSH daemon
service: ansible.builtin.service:
name: sshd name: sshd
state: restarted state: restarted
- name: Restart the filebeat daemon - name: Restart the filebeat daemon
service: ansible.builtin.service:
name: filebeat name: filebeat
state: restarted state: restarted
- name: Restart the metricbeat daemon - name: Restart the metricbeat daemon
service: ansible.builtin.service:
name: metricbeat name: metricbeat
state: restarted state: restarted
- name: Restart the packetbeat daemon - name: Restart the packetbeat daemon
service: ansible.builtin.service:
name: packetbeat name: packetbeat
state: restarted state: restarted
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
- pf - pf
- name: Set hosts entries - name: Set hosts entries
copy: ansible.builtin.copy:
dest: /etc/hosts dest: /etc/hosts
mode: preserve mode: preserve
src: hosts src: hosts
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
regexp: ' 8021/tcp' # noqa 203 regexp: ' 8021/tcp' # noqa 203
- line: 'bittorrent 51413/tcp' # noqa 203 - line: 'bittorrent 51413/tcp' # noqa 203
regexp: ' 51413/tcp' # noqa 203 regexp: ' 51413/tcp' # noqa 203
lineinfile: ansible.builtin.lineinfile:
backup: true backup: true
line: '{{ item.line }}' line: '{{ item.line }}'
path: /etc/services path: /etc/services
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
- pf - pf
- name: Generate the Unbound root anchor file - name: Generate the Unbound root anchor file
command: ansible.builtin.command:
cmd: /usr/sbin/unbound-anchor -a /var/unbound/db/root.key cmd: /usr/sbin/unbound-anchor -a /var/unbound/db/root.key
creates: /var/unbound/db/root.key creates: /var/unbound/db/root.key
tags: tags:
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
- unbound - unbound
- name: Set DNS resolving - name: Set DNS resolving
copy: ansible.builtin.copy:
content: |- content: |-
search shore.co.il search shore.co.il
nameserver 127.0.0.1 nameserver 127.0.0.1
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
authname 'ns_nimadar@014' authkey '{{ bezeqint_password }}' up authname 'ns_nimadar@014' authkey '{{ bezeqint_password }}' up
dest 0.0.0.1 dest 0.0.0.1
!/sbin/route add default -ifp pppoe0 62.219.131.121 !/sbin/route add default -ifp pppoe0 62.219.131.121
copy: ansible.builtin.copy:
content: '{{ item.value }}' content: '{{ item.value }}'
dest: /etc/hostname.{{ item.key }} dest: /etc/hostname.{{ item.key }}
owner: root owner: root
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
- network - network
- name: Configure the Unbound DNS resolver - name: Configure the Unbound DNS resolver
file: ansible.builtin.file:
path: /var/unbound/etc/unbound.conf.d path: /var/unbound/etc/unbound.conf.d
mode: 0o0755 mode: 0o0755
state: directory state: directory
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
- network - network
- name: Configure Ubnound DNS resolver - name: Configure Ubnound DNS resolver
lineinfile: ansible.builtin.lineinfile:
insertafter: EOF insertafter: EOF
line: >- line: >-
include: "/var/unbound/etc/unbound.conf.d/*.conf" include: "/var/unbound/etc/unbound.conf.d/*.conf"
...@@ -122,7 +122,7 @@ ...@@ -122,7 +122,7 @@
- name: Configure the Unbound DNS resolver - name: Configure the Unbound DNS resolver
loop: loop:
- shore.co.il.conf - shore.co.il.conf
copy: ansible.builtin.copy:
dest: '/var/unbound/etc/unbound.conf.d/{{ item }}' dest: '/var/unbound/etc/unbound.conf.d/{{ item }}'
mode: preserve mode: preserve
src: 'unbound/{{ item }}' src: 'unbound/{{ item }}'
...@@ -136,7 +136,7 @@ ...@@ -136,7 +136,7 @@
- network - network
- name: Enable the Unbound DNS resolver - name: Enable the Unbound DNS resolver
service: ansible.builtin.service:
enabled: true enabled: true
name: unbound name: unbound
state: started state: started
...@@ -146,7 +146,7 @@ ...@@ -146,7 +146,7 @@
- network - network
- name: Configure PF - name: Configure PF
copy: ansible.builtin.copy:
dest: /etc/pf.conf dest: /etc/pf.conf
mode: 0o0600 mode: 0o0600
src: pf.conf src: pf.conf
...@@ -159,7 +159,7 @@ ...@@ -159,7 +159,7 @@
- network - network
- name: Enable the FTP proxy - name: Enable the FTP proxy
service: ansible.builtin.service:
enabled: true enabled: true
name: ftpproxy name: ftpproxy
state: started state: started
...@@ -169,7 +169,7 @@ ...@@ -169,7 +169,7 @@
- network - network
- name: Apply changes (if needed) to properly setup networking - name: Apply changes (if needed) to properly setup networking
meta: flush_handlers ansible.builtin.meta: flush_handlers
tags: tags:
- always - always
...@@ -188,21 +188,21 @@ ...@@ -188,21 +188,21 @@
- packages - packages
- name: Allow Bash as a login shell - name: Allow Bash as a login shell
lineinfile: ansible.builtin.lineinfile:
line: /usr/local/bin/bash line: /usr/local/bin/bash
path: /etc/shells path: /etc/shells
tags: tags:
- bash - bash
- name: Set Bash as the login shell - name: Set Bash as the login shell
user: ansible.builtin.user:
name: '{{ ansible_facts.env["DOAS_USER"] }}' name: '{{ ansible_facts.env["DOAS_USER"] }}'
shell: /usr/local/bin/bash shell: /usr/local/bin/bash
tags: tags:
- bash - bash
- name: Set boot configuration - name: Set boot configuration
copy: ansible.builtin.copy:
content: | content: |
stty com1 115200 stty com1 115200
set tty com1 set tty com1
...@@ -215,7 +215,7 @@ ...@@ -215,7 +215,7 @@
- boot - boot
- name: Configure the NSD DNS server - name: Configure the NSD DNS server
file: ansible.builtin.file:
path: /var/nsd/etc/nsd.conf.d path: /var/nsd/etc/nsd.conf.d
mode: 0o0755 mode: 0o0755
state: directory state: directory
...@@ -232,7 +232,7 @@ ...@@ -232,7 +232,7 @@
- line: >- - line: >-
ip-address: 62.219.131.121 ip-address: 62.219.131.121
insertafter: 'server:' insertafter: 'server:'
lineinfile: ansible.builtin.lineinfile:
insertafter: '{{ item.insertafter }}' insertafter: '{{ item.insertafter }}'
line: '{{ item.line }}' line: '{{ item.line }}'
path: /var/nsd/etc/nsd.conf path: /var/nsd/etc/nsd.conf
...@@ -249,7 +249,7 @@ ...@@ -249,7 +249,7 @@
- shore.co.il.conf - shore.co.il.conf
- nehe.sr.conf - nehe.sr.conf
- nehes.co.conf - nehes.co.conf
copy: ansible.builtin.copy:
dest: '/var/nsd/etc/nsd.conf.d/{{ item }}' dest: '/var/nsd/etc/nsd.conf.d/{{ item }}'
mode: preserve mode: preserve
src: 'nsd/{{ item }}' src: 'nsd/{{ item }}'
...@@ -267,7 +267,7 @@ ...@@ -267,7 +267,7 @@
- shore.co.il - shore.co.il
- nehe.sr - nehe.sr
- nehes.co - nehes.co
copy: ansible.builtin.copy:
dest: '/var/nsd/zones/{{ item }}' dest: '/var/nsd/zones/{{ item }}'
mode: preserve mode: preserve
src: 'nsd/{{ item }}' src: 'nsd/{{ item }}'
...@@ -281,7 +281,7 @@ ...@@ -281,7 +281,7 @@
- network - network
- name: Enable the NSD DNS server - name: Enable the NSD DNS server
service: ansible.builtin.service:
enabled: true enabled: true
name: nsd name: nsd
state: started state: started
...@@ -291,7 +291,7 @@ ...@@ -291,7 +291,7 @@
- network - network
- name: Configure the DHCP daemon - name: Configure the DHCP daemon
copy: ansible.builtin.copy:
dest: /etc/dhcpd.conf dest: /etc/dhcpd.conf
mode: preserve mode: preserve
src: dhcpd.conf src: dhcpd.conf
...@@ -304,7 +304,7 @@ ...@@ -304,7 +304,7 @@
- network - network
- name: Enable the DHCP daemon - name: Enable the DHCP daemon
service: ansible.builtin.service:
enabled: true enabled: true
name: dhcpd name: dhcpd
state: started state: started
...@@ -315,7 +315,7 @@ ...@@ -315,7 +315,7 @@
- network - network
- name: Configure HAProxy - name: Configure HAProxy
copy: ansible.builtin.copy:
backup: true backup: true
dest: /etc/haproxy/haproxy.cfg dest: /etc/haproxy/haproxy.cfg
mode: preserve mode: preserve
...@@ -329,7 +329,7 @@ ...@@ -329,7 +329,7 @@
- network - network
- name: Enable HAProxy - name: Enable HAProxy
service: ansible.builtin.service:
enabled: true enabled: true
name: haproxy name: haproxy
state: started state: started
...@@ -339,7 +339,7 @@ ...@@ -339,7 +339,7 @@
- network - network
- name: Configure mail relaying - name: Configure mail relaying
lineinfile: ansible.builtin.lineinfile:
line: action "outbound" relay host host01.shore.co.il line: action "outbound" relay host host01.shore.co.il
path: /etc/mail/smtpd.conf path: /etc/mail/smtpd.conf
regexp: action "outbound" relay regexp: action "outbound" relay
...@@ -351,7 +351,7 @@ ...@@ -351,7 +351,7 @@
- mail - mail
- name: Configure the spam deferral daemon - name: Configure the spam deferral daemon
copy: ansible.builtin.copy:
dest: /etc/mail/spamd.conf dest: /etc/mail/spamd.conf
mode: preserve mode: preserve
src: mail/spamd.conf src: mail/spamd.conf
...@@ -364,7 +364,7 @@ ...@@ -364,7 +364,7 @@
- network - network
- name: Enable the spam deferral daemon - name: Enable the spam deferral daemon
lineinfile: ansible.builtin.lineinfile:
line: >- line: >-
spamd_flags="-h smtp.shore.co.il -G25:12:864" spamd_flags="-h smtp.shore.co.il -G25:12:864"
path: /etc/rc.conf.local path: /etc/rc.conf.local
...@@ -379,7 +379,7 @@ ...@@ -379,7 +379,7 @@
loop: loop:
- root - root
- nimrod - nimrod
lineinfile: ansible.builtin.lineinfile:
line: '{{ item }}: {{ item }}@shore.co.il' line: '{{ item }}: {{ item }}@shore.co.il'
path: /etc/mail/aliases path: /etc/mail/aliases
state: present state: present
...@@ -391,7 +391,7 @@ ...@@ -391,7 +391,7 @@
- network - network
- name: Configure the BGP daemon - name: Configure the BGP daemon
copy: ansible.builtin.copy:
dest: /etc/bgpd.conf dest: /etc/bgpd.conf
mode: 0o0600 mode: 0o0600
src: bgpd.conf src: bgpd.conf
...@@ -405,7 +405,7 @@ ...@@ -405,7 +405,7 @@
- network - network
- name: Enable the BDP daemon - name: Enable the BDP daemon
service: ansible.builtin.service:
enabled: true enabled: true
name: bgpd name: bgpd
state: started state: started
...@@ -417,7 +417,7 @@ ...@@ -417,7 +417,7 @@
- network - network
- name: Configure the NTP daemon - name: Configure the NTP daemon
copy: ansible.builtin.copy:
content: | content: |
server 0.pool.ntp.org server 0.pool.ntp.org
server 1.pool.ntp.org server 1.pool.ntp.org
...@@ -433,7 +433,7 @@ ...@@ -433,7 +433,7 @@
- ntp - ntp
- name: Enable the NTP daemon - name: Enable the NTP daemon
service: ansible.builtin.service:
enabled: true enabled: true
name: ntpd name: ntpd
state: started state: started
...@@ -460,7 +460,7 @@ ...@@ -460,7 +460,7 @@
name: idk name: idk
special_time: daily special_time: daily
state: absent state: absent
cron: ansible.builtin.cron:
job: '{{ item.job }}' job: '{{ item.job }}'
name: '{{ item.name }}' name: '{{ item.name }}'
special_time: '{{ item.special_time }}' special_time: '{{ item.special_time }}'
...@@ -474,7 +474,7 @@ ...@@ -474,7 +474,7 @@
- dns - dns
- name: Disable the audio server - name: Disable the audio server
service: ansible.builtin.service:
enabled: false enabled: false
name: sndiod name: sndiod
state: stopped state: stopped
...@@ -484,14 +484,14 @@ ...@@ -484,14 +484,14 @@
- sndiod - sndiod
- name: Configure the SSH daemon - name: Configure the SSH daemon
include_tasks: ansible.builtin.include_tasks:
file: '{{ playbook_dir }}/tasks/sshd_config.yaml' file: '{{ playbook_dir }}/tasks/sshd_config.yaml'
tags: tags:
- always - always
# yamllint disable-line rule:line-length # yamllint disable-line rule:line-length
- name: Configure the daily Cron job (skip email if there's nothing to report, report on pending system patches). - name: Configure the daily Cron job (skip email if there's nothing to report, report on pending system patches).
copy: ansible.builtin.copy:
content: | content: |
VERBOSESTATUS=0 VERBOSESTATUS=0
syspatch -c syspatch -c
...@@ -534,7 +534,7 @@ ...@@ -534,7 +534,7 @@
- name: Enable beats - name: Enable beats
loop: *beats loop: *beats
service: ansible.builtin.service:
enabled: true enabled: true
name: '{{ item }}' name: '{{ item }}'
state: started state: started
......
--- ---
- name: Validate assertions - name: Validate assertions
assert: ansible.builtin.assert:
that: that:
- domains is iterable - domains is iterable
- host is string - host is string
...@@ -103,7 +103,7 @@ ...@@ -103,7 +103,7 @@
register: acme_challenge register: acme_challenge
- name: Debug {{ host }} challenge - name: Debug {{ host }} challenge
debug: ansible.builtin.debug:
var: acme_challenge var: acme_challenge
verbosity: 1 verbosity: 1
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
- name: Create ACME challenge directory on {{ host }} - name: Create ACME challenge directory on {{ host }}
delegate_to: &delegate_to '{{ delegate_host|default(host) }}' delegate_to: &delegate_to '{{ delegate_host|default(host) }}'
file: ansible.builtin.file:
mode: 0o0755 mode: 0o0755
path: /var/www/www.shore.co.il/.well-known/acme-challenge path: /var/www/www.shore.co.il/.well-known/acme-challenge
state: directory state: directory
...@@ -122,7 +122,7 @@ ...@@ -122,7 +122,7 @@
delegate_to: *delegate_to delegate_to: *delegate_to
with_dict: | with_dict: |
{{ acme_challenge['challenge_data'] }} {{ acme_challenge['challenge_data'] }}
copy: ansible.builtin.copy:
content: |- content: |-
{{ item.value['http-01']['resource_value'] }} {{ item.value['http-01']['resource_value'] }}
# yamllint disable-line rule:line-length # yamllint disable-line rule:line-length
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
- src: *cert_src - src: *cert_src
dest: /var/ssl/{{ filename|default('site') }}.crt dest: /var/ssl/{{ filename|default('site') }}.crt
mode: 0o0444 mode: 0o0444
copy: ansible.builtin.copy:
src: |- src: |-
{{ item.src }} {{ item.src }}
dest: |- dest: |-
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
PubkeyAcceptedKeyTypes: >- PubkeyAcceptedKeyTypes: >-
-ssh-rsa, -ssh-rsa,
ssh-rsa-cert-v01@openssh.com ssh-rsa-cert-v01@openssh.com
lineinfile: ansible.builtin.lineinfile:
backup: true backup: true
line: '{{ item.key }} {{ item.value|replace(" ", "") }}' line: '{{ item.key }} {{ item.value|replace(" ", "") }}'
path: /etc/ssh/sshd_config path: /etc/ssh/sshd_config
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment