forked from infra/ansible
1
0
Fork 0

replace deprecated with_items with loop

This commit is contained in:
Kishi85 2020-02-03 19:46:31 +01:00
parent 4a11950728
commit cc91246e92
24 changed files with 47 additions and 47 deletions

View File

@ -2,7 +2,7 @@
- name: Install dependencies
apt: name={{ item }}
with_items:
loop:
- git
- python-cryptography
- python-dnspython

View File

@ -2,7 +2,7 @@
- name: Install dependencies
apt: name={{ item }}
with_items:
loop:
- git
- python3-flask
- python3-flaskext.wtf

View File

@ -2,7 +2,7 @@
- name: Install misc software
apt: name={{ item }}
with_items:
loop:
- dnsutils
- htop
- less
@ -17,7 +17,7 @@
- name: Install software on KVM VMs
apt: name={{ item }}
with_items:
loop:
- acpid
- qemu-guest-agent
when: ansible_virtualization_role == "guest" and ansible_virtualization_type == "kvm"
@ -25,7 +25,7 @@
- name: Configure misc software
copy: src={{ item.src }} dest={{ item.dest }}
diff: no
with_items:
loop:
- { src: '.zshrc', dest: '/root/.zshrc' }
- { src: '.zshrc.local', dest: '/root/.zshrc.local' }
- { src: 'motd', dest: '/etc/motd' }
@ -45,7 +45,7 @@
- name: Fix network interface names
copy: src={{ item }} dest=/etc/systemd/network/{{ item }}
with_items:
loop:
- 50-virtio-kernel-names.link
- 99-default.link
notify: update-initramfs

View File

@ -2,13 +2,13 @@
- name: Install misc software
pkgng: name={{ item }}
with_items:
loop:
- vim-lite
- htop
- zsh
- name: Configure misc software
copy: src={{ item.src }} dest={{ item.dest }}
with_items:
loop:
- { src: '.zshrc', dest: '/root/.zshrc' }
- { src: '.zshrc.local', dest: '/root/.zshrc.local' }

View File

@ -2,7 +2,7 @@
- name: Install misc software
apt: name={{ item }}
with_items:
loop:
- dnsutils
- htop
- ipmitool
@ -13,7 +13,7 @@
- name: Configure misc software
copy: src={{ item.src }} dest={{ item.dest }}
with_items:
loop:
- { src: '.zshrc', dest: '/root/.zshrc' }
- { src: '.zshrc.local', dest: '/root/.zshrc.local' }
- { src: 'motd', dest: '/etc/motd' }

View File

@ -5,7 +5,7 @@
- name: Configure dhcp server
template: src={{ item }}.j2 dest=/etc/{{ item }}
with_items:
loop:
- default/isc-dhcp-server
- dhcp/dhcpd.conf
notify: Restart isc-dhcp-server

View File

@ -2,7 +2,7 @@
- name: Install powerdns
apt: name={{ item }}
with_items:
loop:
- pdns-server
- pdns-backend-sqlite3

View File

@ -2,6 +2,6 @@
- name: Restart powerdns
service: name={{ item }} state=restarted
with_items:
loop:
- pdns
- pdns-recursor

View File

@ -2,7 +2,7 @@
- name: Install powerdns
apt: name={{ item }}
with_items:
loop:
- pdns-server
- pdns-recursor
@ -12,7 +12,7 @@
- name: Configure powerdns
template: src={{ item }}.j2 dest=/etc/powerdns/{{ item }}
notify: Restart powerdns
with_items:
loop:
- pdns.conf
- recursor.conf
- bindbackend.conf
@ -21,6 +21,6 @@
- name: Start the powerdns services
service: name={{ item }} state=started enabled=yes
with_items:
loop:
- pdns
- pdns-recursor

View File

@ -14,7 +14,7 @@
- name: Install PostgreSQL
apt: name={{ item }}
with_items:
loop:
- postgresql
- python-psycopg2

View File

@ -29,7 +29,7 @@
- name: Install packages
apt: name={{ item }}
with_items:
loop:
- build-essential
- git
- nodejs

View File

@ -2,7 +2,7 @@
- name: Install dependencies
apt: name={{ item }}
with_items:
loop:
- fping
- git
- graphviz
@ -47,7 +47,7 @@
path: "{{ item }}"
regexp: ';?date\.timezone'
line: 'date.timezone = Europe/Berlin'
with_items:
loop:
- /etc/php/7.3/cli/php.ini
- /etc/php/7.3/fpm/php.ini

View File

@ -22,7 +22,7 @@
- name: Run postmap
command: postmap /etc/{{ item }}
with_items:
loop:
- postfix/helo_access
- postfix/recipient_access
- postfix/transport

View File

@ -8,7 +8,7 @@
- name: Install packages
apt: name={{ item }}
with_items:
loop:
- bsd-mailx
- dovecot-core
- dovecot-imapd
@ -55,7 +55,7 @@
- name: Render rspamd config templates
template: src=rspamd/local.d/{{ item }}.j2 dest=/etc/rspamd/local.d/{{ item }}
notify: Restart rspamd
with_items:
loop:
- options.inc
- settings.conf
- arc.conf
@ -63,7 +63,7 @@
- name: Copy spam learn/unlearn sieve and shell scripts
copy: src=dovecot/{{ item }} dest=/var/vmail/.sieve/{{ item }}
with_items:
loop:
- bin/learn-spam.sh
- bin/learn-ham.sh
- move-spam.sieve
@ -72,7 +72,7 @@
- name: Configure dovecot
template: src={{ item }}.j2 dest=/etc/{{ item }}
with_items:
loop:
- dovecot/dovecot-ldap.conf.ext
- dovecot/dovecot-ldap.conf.lmtp
- dovecot/local.conf
@ -80,14 +80,14 @@
- name: Compile sieve scripts
shell: sievec /var/vmail/.sieve/{{ item|basename }}
with_items:
loop:
- move-spam.sieve
- report-spam.sieve
- report-ham.sieve
- name: Ensure learn scripts are executable
file: mode=0750 path=/var/vmail/.sieve/bin/{{ item }}
with_items:
loop:
- learn-spam.sh
- learn-ham.sh
@ -104,7 +104,7 @@
- name: Configure mailman
template: src={{ item }}.j2 dest=/etc/{{ item }}
with_items:
loop:
- mailman/mm_cfg.py
notify: Restart postfix
@ -129,21 +129,21 @@
- name: Configure postfix
template: src={{ item }}.j2 dest=/etc/{{ item }}
with_items:
loop:
- postfix/main.cf
- postfix/master.cf
notify: Restart postfix
- name: Configure postsrsd
template: src={{ item }}.j2 dest=/etc/{{ item }}
with_items:
loop:
- default/postsrsd
- postsrsd.secret
notify: Restart postsrsd
- name: Configure postfix maps
template: src={{ item }}.j2 dest=/etc/{{ item }}
with_items:
loop:
- postfix/helo_access
- postfix/transport
- postfix/virtual-alias

View File

@ -11,7 +11,7 @@
- name: Install matrix
apt: name={{ item }}
with_items:
loop:
- matrix-synapse-py3
- postgresql
- python-psycopg2
@ -28,7 +28,7 @@
- name: Configure matrix
template: src=matrix-synapse/{{ item }}.j2 dest=/etc/matrix-synapse/{{ item }}
with_items:
loop:
- homeserver.yaml
- log.yaml
- conf.d/server_name.yaml

View File

@ -2,7 +2,7 @@
- name: Install software for members
apt: name={{ item }}
with_items:
loop:
- ansible
- git
- irssi

View File

@ -11,7 +11,7 @@
- name: Install packages
apt: name={{ item }}
with_items:
loop:
- php-redis
- php7.3
- php7.3-bcmath

View File

@ -20,7 +20,7 @@
- name: Create DH parameters
command: openssl dhparam -outform PEM -out {{ item }} 2048 creates={{ item }}
when: nginx_ssl == True
with_items:
loop:
- /etc/nginx/dhparam.pem
- name: Configure nginx

View File

@ -2,7 +2,7 @@
- name: Install dependencies
apt: name={{ item }}
with_items:
loop:
- php7.3-fpm
- php7.3-ldap
- php7.3-mysql

View File

@ -9,7 +9,7 @@
- name: Install prosody
apt: name={{ item }}
with_items:
loop:
- prosody
- libsasl2-modules-ldap
- sasl2-bin
@ -25,7 +25,7 @@
- name: Configure sasl
copy: src={{ item }} dest=/etc/{{ item }}
with_items:
loop:
- default/saslauthd
- sasl/xmpp.conf

View File

@ -24,19 +24,19 @@
- name: Create DH parameters
command: openssl dhparam -outform PEM -out {{ item }} 2048 creates={{ item }}
with_items:
loop:
- /etc/freeradius/3.0/certs/dh
notify: Restart freeradius
- name: Configure radius server
template: src={{ item }}.j2 dest=/etc/freeradius/3.0/{{ item }} owner=freerad group=freerad
with_items:
loop:
- clients.conf
notify: Restart freeradius
- name: Configure radius server
copy: src={{ item }} dest=/etc/freeradius/3.0/{{ item }} owner=freerad group=freerad
with_items:
loop:
- mods-available/eap
- mods-config/files/authorize
- sites-available/default
@ -47,7 +47,7 @@
- name: Ensure sites are symlinked
file: src=../sites-available/{{ item }} dest=/etc/freeradius/3.0/sites-enabled/{{ item }} state=link
with_items:
loop:
- default
- inner-tunnel
notify: Restart freeradius

View File

@ -13,7 +13,7 @@
- name: Copy schema definitons
copy: src={{ item }} dest=/etc/ldap/{{ item }}
with_items:
loop:
- schema/kitchen.schema
- schema/openssh-lpk.schema
- schema/radius.schema

View File

@ -2,12 +2,12 @@
- name: Install unattended upgrades
apt: name={{ item }}
with_items:
loop:
- unattended-upgrades
- debian-goodies
- name: Configure unattended upgrades
template: src={{ item }}.j2 dest=/etc/apt/apt.conf.d/{{ item }}
with_items:
loop:
- 02periodic
- 50unattended-upgrades

View File

@ -2,7 +2,7 @@
- name: Install dependencies
apt: name={{ item }}
with_items:
loop:
- php-fpm
- php-ldap
- php-sqlite3