Przeglądaj źródła

Replace "action: $action" by "$action:"

Emmanuel Bouthenot 11 lat temu
rodzic
commit
4138102811

+ 5 - 5
roles/common/handlers/base.yml

@@ -1,16 +1,16 @@
 - name: Reload apt cache
-  action: command apt-get update
+  command: apt-get update
 
 - name: Apply kernel configuration (proc)
-  action: service name=procps state=restarted
+  service: name=procps state=restarted
 
 - name: Apply kernel configuration (sys)
-  action: service name=sysfsutils state=restarted
+  service: name=sysfsutils state=restarted
 
 - name: Refresh sysfs configuration
-  action: shell cat /etc/sysfs.d/* > /etc/sysfs.conf
+  shell: cat /etc/sysfs.d/* > /etc/sysfs.conf
   notify:
     - Apply kernel configuration (sys)
 
 - name: Update motd
-  action: shell toilet -f future ${ansible_fqdn} > /var/run/motd && echo >> /var/run/motd && uname -snrvm >> /var/run/motd && echo >> /var/run/motd
+  shell: toilet -f future ${ansible_fqdn} > /var/run/motd && echo >> /var/run/motd && uname -snrvm >> /var/run/motd && echo >> /var/run/motd

+ 1 - 1
roles/common/handlers/smartd.yml

@@ -1,2 +1,2 @@
 - name: Restart smartmontools
-  action: service name=smartmontools state=restarted
+  service: name=smartmontools state=restarted

+ 2 - 2
roles/common/handlers/smtp.yml

@@ -1,5 +1,5 @@
 - name: Regenerate aliases cache
-  action: command newaliases
+  command: newaliases
 
 - name: Restart postfix
-  action: service name=postfix state=restarted
+  service: name=postfix state=restarted

+ 1 - 1
roles/common/handlers/ssh.yml

@@ -1,2 +1,2 @@
 - name: Restart ssh
-  action: service name=ssh state=restarted
+  service: name=ssh state=restarted

+ 13 - 13
roles/common/tasks/base.yml

@@ -1,24 +1,24 @@
 - name: Install hosts file
-  action: template src=hosts.j2 dest=/etc/hosts owner=root group=root mode=0644
+  template: src=hosts.j2 dest=/etc/hosts owner=root group=root mode=0644
   notify:
     - Update motd
 
 - name: Install hosts.deny file
-  action: template src=hosts.deny.j2 dest=/etc/hosts.deny owner=root group=root mode=0644
+  template: src=hosts.deny.j2 dest=/etc/hosts.deny owner=root group=root mode=0644
 
 - name: Write /etc/apt/sources.list
-  action: template src=apt/sources.${ansible_lsb.codename}.list.j2 dest=/etc/apt/sources.list owner=root group=root mode=0644
+  template: src=apt/sources.${ansible_lsb.codename}.list.j2 dest=/etc/apt/sources.list owner=root group=root mode=0644
   notify:
     - Reload apt cache
 
 - name: Write /etc/apt/apt.conf.d configuration files
-  action: template src=apt/${item}.j2 dest=/etc/apt/apt.conf.d/${item} owner=root group=root mode=0644
+  template: src=apt/${item}.j2 dest=/etc/apt/apt.conf.d/${item} owner=root group=root mode=0644
   with_items:
     - local-recommends
     - local-pdiffs
 
 - name: Install base packages
-  action: ${ansible_pkg_mgr} pkg=${item} install_recommends=no state=installed update_cache=yes
+  apt: pkg=${item} install_recommends=no state=installed update_cache=yes
   with_items:
     - apticron
     - locales-all
@@ -39,24 +39,24 @@
     - rsync
 
 - name: Install kernel configuration (proc)
-  action: template src=kernel/sysctl.d/${item}.j2 dest=/etc/sysctl.d/${item} owner=root group=root mode=0644
+  template: src=kernel/sysctl.d/${item}.j2 dest=/etc/sysctl.d/${item} owner=root group=root mode=0644
   with_items:
       - 10-increase-file-descriptors.conf
   notify:
     - Apply kernel configuration (proc)
 
 - name: Create sysfs configuration directory - /etc/sysfs.d
-  action: file path=/etc/sysfs.d state=directory owner=root group=root mode=0755
+  file: path=/etc/sysfs.d state=directory owner=root group=root mode=0755
 
 - name: Install kernel configuration (sys)
-  action: template src=kernel/sysfs.d/${item}.j2 dest=/etc/sysfs.d/${item} owner=root group=root mode=0644
+  template: src=kernel/sysfs.d/${item}.j2 dest=/etc/sysfs.d/${item} owner=root group=root mode=0644
   with_items:
       - 00-sysfs-prolog.conf
   notify:
     - Refresh sysfs configuration
 
 - name: Install kernel configuration (sys) for disks
-  action: template src=kernel/sysfs.d/${item}.j2 dest=/etc/sysfs.d/${item} owner=root group=root mode=0644
+  template: src=kernel/sysfs.d/${item}.j2 dest=/etc/sysfs.d/${item} owner=root group=root mode=0644
   with_items:
       - 10-disks.conf
   notify:
@@ -64,16 +64,16 @@
   when: ${sysfs_disk_settings}
 
 - name: Install sudo configuration
-  action: template src=sudo/local-admin.j2 dest=/etc/sudoers.d/local-admin owner=root group=root mode=0440
+  template: src=sudo/local-admin.j2 dest=/etc/sudoers.d/local-admin owner=root group=root mode=0440
 
 - name: Install unprivileged user
-  action: user name="${item.user}" comment="${item.fullname}" groups=adm,operator,sudo append=yes shell=/bin/zsh state=present
+  user: name="${item.user}" comment="${item.fullname}" groups=adm,operator,sudo append=yes shell=/bin/zsh state=present
   with_items: ${admins}
 
 - name: Install SSH key for unprivileged user
-  action: authorized_key user="${item.user}" key="$FILE(roles/common/data/users/${item.user}/id_rsa.pub)" state=present
+  authorized_key: user="${item.user}" key="$FILE(roles/common/data/users/${item.user}/id_rsa.pub)" state=present
   with_items: ${admins}
 
 - name: Install SSH key for root
-  action: authorized_key user=root key="$FILE(roles/common/data/users/${item.user}/id_rsa.pub)" state=present
+  authorized_key: user=root key="$FILE(roles/common/data/users/${item.user}/id_rsa.pub)" state=present
   with_items: ${admins}

+ 2 - 2
roles/common/tasks/ovh.yml

@@ -1,5 +1,5 @@
 - name: Install kernel configuration for OVH dedicated servers (proc)
-  action: template src=kernel/sysctl.d/${item}.j2 dest=/etc/sysctl.d/${item} owner=root group=root mode=0644
+  template: src=kernel/sysctl.d/${item}.j2 dest=/etc/sysctl.d/${item} owner=root group=root mode=0644
   with_items:
       - 01-ovh-network.conf
   notify:
@@ -7,7 +7,7 @@
   when: ${with_ovh}
 
 - name: Install kernel configuration for OVH dedicated servers (sys)
-  action: template src=kernel/sysfs.d/${item}.j2 dest=/etc/sysfs.d/${item} owner=root group=root mode=0644
+  template: src=kernel/sysfs.d/${item}.j2 dest=/etc/sysfs.d/${item} owner=root group=root mode=0644
   with_items:
       - 01-ovh-network.conf
   notify:

+ 8 - 8
roles/common/tasks/security.yml

@@ -1,23 +1,23 @@
 - name: Install auto upgrades package
-  action: ${ansible_pkg_mgr} pkg=unattended-upgrades state=installed update_cache=yes
+  apt: pkg=unattended-upgrades state=installed update_cache=yes
   when: ${with_auto_upgrade}
 
 - name: Configure auto upgrades
-  action: template src=${item} dest=/etc/apt/apt.conf.d/20auto-upgrades owner=root group=root mode=0644
+  template: src=${item} dest=/etc/apt/apt.conf.d/20auto-upgrades owner=root group=root mode=0644
   first_available_file:
     - apt/auto-upgrades.${ansible_lsb.codename}.j2
     - apt/auto-upgrades.j2
   when: ${with_auto_upgrade}
 
 - name: Install logcheck packages
-  action: ${ansible_pkg_mgr} pkg=${item} state=installed update_cache=yes
+  apt: pkg=${item} state=installed update_cache=yes
   with_items:
     - logcheck
     - logcheck-database
   when: ${with_logcheck}
 
 - name: Install local configuration files for logcheck
-  action: copy src=logcheck/${item}_local dest=/etc/logcheck/ignore.d.server/${item}_local owner=root group=root mode=0644
+  copy: src=logcheck/${item}_local dest=/etc/logcheck/ignore.d.server/${item}_local owner=root group=root mode=0644
   with_items:
     - ansible
     - amavisd-new
@@ -45,17 +45,17 @@
   when: ${with_logcheck}
 
 - name: Update logcheck cron job
-  action: template src=cron/logcheck.j2 dest=/etc/cron.d/logcheck owner=root group=root mode=0644
+  template: src=cron/logcheck.j2 dest=/etc/cron.d/logcheck owner=root group=root mode=0644
   when: ${with_logcheck}
 
 - name: Update rkhunter default/init parameters
-  action: template src=rkhunter/default.j2 dest=/etc/default/rkhunter owner=root group=root mode=0644
+  template: src=rkhunter/default.j2 dest=/etc/default/rkhunter owner=root group=root mode=0644
   when: ${with_rkhunter}
 
 - name: Update rkhunter configuration
-  action: template src=rkhunter/${ansible_lsb.codename}.conf.j2 dest=/etc/rkhunter.conf owner=root group=root mode=0644
+  template: src=rkhunter/${ansible_lsb.codename}.conf.j2 dest=/etc/rkhunter.conf owner=root group=root mode=0644
   when: ${with_rkhunter}
 
 - name: Update chkrootkit configuration
-  action: template src=chkrootkit/chkrootkit.conf.j2 dest=/etc/chkrootkit.conf owner=root group=root mode=0644
+  template: src=chkrootkit/chkrootkit.conf.j2 dest=/etc/chkrootkit.conf owner=root group=root mode=0644
   when: ${with_chkrootkit}

+ 4 - 4
roles/common/tasks/smartd.yml

@@ -1,9 +1,9 @@
 - name: Install smartmontools package
-  action: ${ansible_pkg_mgr} pkg=smartmontools state=installed update_cache=yes
+  apt: pkg=smartmontools state=installed update_cache=yes
   when: ${with_smartd}
 
 - name: Install smartd configuration
-  action: template dest=/etc/smartd.conf owner=root group=root mode=0644
+  template: dest=/etc/smartd.conf owner=root group=root mode=0644
   first_available_file:
     - smartd/smartd.{{ ansible_hostname }}.conf.j2
     - smartd/smartd.conf.j2
@@ -12,11 +12,11 @@
   when: ${with_smartd}
 
 - name: Update smartmontools default/init parameters
-  action: template src=smartd/default.j2 dest=/etc/default/smartmontools owner=root group=root mode=0644
+  template: src=smartd/default.j2 dest=/etc/default/smartmontools owner=root group=root mode=0644
   notify:
     - Restart smartmontools
   when: ${with_smartd}
 
 - name: Ensure smartmontools is running
-  action: service name=smartmontools state=started
+  service: name=smartmontools state=started
   when: ${with_smartd}

+ 3 - 3
roles/common/tasks/smtp.yml

@@ -1,15 +1,15 @@
 - name: Install postfix packages
-  action: apt pkg=postfix state=installed update_cache=yes
+  apt: pkg=postfix state=installed update_cache=yes
   when: ${with_postfix}
 
 - name: Install mail aliases file
-  action: template src=aliases.j2 dest=/etc/aliases owner=root group=root mode=0644
+  template: src=aliases.j2 dest=/etc/aliases owner=root group=root mode=0644
   notify:
     - Regenerate aliases cache
   when: ${with_postfix} or ${with_mail_aliases}
 
 - name: Install postfix main configuration
-  action: template src=postfix/main.cf.j2 dest=/etc/postfix/main.cf owner=root group=root mode=0644
+  template: src=postfix/main.cf.j2 dest=/etc/postfix/main.cf owner=root group=root mode=0644
   notify:
     - Restart postfix
   when: ${with_postfix}

+ 3 - 3
roles/common/tasks/ssh.yml

@@ -1,16 +1,16 @@
 - name: Install ssh packages
-  action: ${ansible_pkg_mgr} pkg=${item} state=installed update_cache=yes
+  apt: pkg=${item} state=installed update_cache=yes
   with_items:
     - openssh-server
     - openssh-client
   when: ${with_ssh}
 
 - name: Install sshd configuration
-  action: template src=ssh/sshd_config.j2 dest=/etc/ssh/sshd_config owner=root group=root mode=0644
+  template: src=ssh/sshd_config.j2 dest=/etc/ssh/sshd_config owner=root group=root mode=0644
   notify:
     - Restart ssh
   when: ${with_ssh}
 
 - name: Ensure ssh is running
-  action: service name=ssh state=started
+  service: name=ssh state=started
   when: ${with_ssh}

+ 2 - 2
roles/dbserver/handlers/mysql.yml

@@ -1,5 +1,5 @@
 - name: Reload mysql
-  action: service name=mysql state=reloaded
+  service: name=mysql state=reloaded
 
 - name: Restart nginx
-  action: service name=mysql state=restarted
+  service: name=mysql state=restarted

+ 3 - 3
roles/dbserver/tasks/mysql.yml

@@ -1,14 +1,14 @@
 - name: Install mysql-server related packages
-  action: ${ansible_pkg_mgr} pkg=${item} state=installed update_cache=yes
+  apt: pkg=${item} state=installed update_cache=yes
   with_items:
     - mysql-server
     - automysqlbackup
   when: ${with_mysql}
 
 - name: Change mysql root default password
-  action: raw if "SELECT VERSION();" | mysql -u root >/dev/null 2>&1 ; then echo "UPDATE mysql.user SET Password=PASSWORD('${mysql_root_password}') WHERE User IN ('', 'root'); FLUSH PRIVILEGES;" | mysql --defaults-file=/etc/mysql/debian.cnf ; fi
+  raw: if "SELECT VERSION();" | mysql -u root >/dev/null 2>&1 ; then echo "UPDATE mysql.user SET Password=PASSWORD('${mysql_root_password}') WHERE User IN ('', 'root'); FLUSH PRIVILEGES;" | mysql --defaults-file=/etc/mysql/debian.cnf ; fi
   when: ${with_mysql}
 
 - name: Ensure mysql-server is running
-  action: service name=mysql state=started
+  service: name=mysql state=started
   when: ${with_mysql}

+ 1 - 1
roles/monitoring/handlers/mon.yml

@@ -1,2 +1,2 @@
 - name: Restart mon
-  action: service name=mon state=restarted
+  service: name=mon state=restarted

+ 3 - 3
roles/monitoring/handlers/munin.yml

@@ -1,8 +1,8 @@
 - name: Restart munin-node
-  action: service name=munin-node state=restarted
+  service: name=munin-node state=restarted
 
 - name: Reload nginx for munin
-  action: service name=nginx state=reloaded
+  service: name=nginx state=reloaded
 
 - name: Reload apache2 for munin
-  action: service name=apache2 state=reloaded
+  service: name=apache2 state=reloaded

+ 7 - 7
roles/monitoring/tasks/mon.yml

@@ -1,25 +1,25 @@
 - name: Install mon packages
-  action: ${ansible_pkg_mgr} pkg=mon state=installed update_cache=yes
+  apt: pkg=mon state=installed update_cache=yes
   when: ${with_mon}
 
 - name: Create need directory for mon configuration
-  action: file path=/etc/mon/mon.d state=directory owner=root group=root mode=0755
+  file: path=/etc/mon/mon.d state=directory owner=root group=root mode=0755
   when: ${with_mon}
 
 - name: Install mon configuration
-  action: template src=mon/${ansible_hostname}.conf.j2 dest=/etc/mon/mon.cf owner=root group=root mode=0644
+  template: src=mon/${ansible_hostname}.conf.j2 dest=/etc/mon/mon.cf owner=root group=root mode=0644
   notify:
     - Restart mon
   when: ${with_mon}
 
 - name: Install mon (default) configuration
-  action: template src=mon/default.j2 dest=/etc/default/mon owner=root group=root mode=0644
+  template: src=mon/default.j2 dest=/etc/default/mon owner=root group=root mode=0644
   notify:
     - Restart mon
   when: ${with_mon}
 
 - name: Install custom mon plugins
-  action: copy src=mon/${item}.monitor dest=/etc/mon/mon.d/${item}.monitor owner=root group=root mode=0755
+  copy: src=mon/${item}.monitor dest=/etc/mon/mon.d/${item}.monitor owner=root group=root mode=0755
   with_items:
     - https
     - imaps
@@ -29,7 +29,7 @@
   when: ${with_mon}
 
 - name: Install mon plugins
-  action: file src=/usr/lib/mon/mon.d/${item}.monitor path=/etc/mon/mon.d/${item}.monitor state=link
+  file: src=/usr/lib/mon/mon.d/${item}.monitor path=/etc/mon/mon.d/${item}.monitor state=link
   with_items:
     - fping
     - http
@@ -41,5 +41,5 @@
   when: ${with_mon}
 
 - name: Ensure mon is running
-  action: service name=mon state=started
+  service: name=mon state=started
   when: ${with_mon}

+ 12 - 12
roles/monitoring/tasks/munin.yml

@@ -1,13 +1,13 @@
 - name: Install munin packages
-  action: ${ansible_pkg_mgr} pkg=munin state=installed update_cache=yes
+  apt: pkg=munin state=installed update_cache=yes
   when: ${with_munin}
 
 - name: Install munin configuration
-  action: template src=munin/munin.conf.j2 dest=/etc/munin/munin.conf owner=root group=root mode=0644
+  template: src=munin/munin.conf.j2 dest=/etc/munin/munin.conf owner=root group=root mode=0644
   when: ${with_munin}
 
 - name: Install munin-node packages
-  action: ${ansible_pkg_mgr} pkg=${item} state=installed update_cache=yes
+  apt: pkg=${item} state=installed update_cache=yes
   with_items:
     - munin-node
     - munin-plugins-extra
@@ -19,54 +19,54 @@
   when: ${with_munin_node}
 
 - name: Create need directories for munin-node configuration
-  action: file path=/etc/munin/${item} state=directory owner=root group=root mode=0755
+  file: path=/etc/munin/${item} state=directory owner=root group=root mode=0755
   with_items:
     - plugins
     - plugin-conf.d
   when: ${with_munin_node}
 
 - name: Install munin node configuration
-  action: template src=munin/munin-node.conf.j2 dest=/etc/munin/munin-node.conf owner=root group=root mode=0644
+  template: src=munin/munin-node.conf.j2 dest=/etc/munin/munin-node.conf owner=root group=root mode=0644
   notify:
     - Restart munin-node
   when: ${with_munin_node}
 
 - name: Install munin node plugins configuration
-  action: template src=munin/munin-node.conf.plugins.j2 dest=/etc/munin/plugin-conf.d/munin-node owner=root group=root mode=0644
+  template: src=munin/munin-node.conf.plugins.j2 dest=/etc/munin/plugin-conf.d/munin-node owner=root group=root mode=0644
   notify:
     - Restart munin-node
   when: ${with_munin_node}
 
 - name: Autoconfigure munin-node plugins
-  action: munin_node_autoconf families=auto,manual,contrib excludes=apc_nis,apt,apt_all,port_,ipmi_fans,ipmi_power,ipmi_temp,ntp_,ircu,ntp_kernel_err,ntp_kernel_pll_freq,ntp_kernel_pll_off,ntp_offset,ntp_states
+  munin_node_autoconf: families=auto,manual,contrib excludes=apc_nis,apt,apt_all,port_,ipmi_fans,ipmi_power,ipmi_temp,ntp_,ircu,ntp_kernel_err,ntp_kernel_pll_freq,ntp_kernel_pll_off,ntp_offset,ntp_states
   notify:
     - Restart munin-node
   when: ${with_munin_node}
 
 - name: Install nginx virtual host for munin (sites-available)
-  action: template src=munin/nginx_vhost.j2 dest=/etc/nginx/sites-available/munin owner=root group=root mode=0644
+  template: src=munin/nginx_vhost.j2 dest=/etc/nginx/sites-available/munin owner=root group=root mode=0644
   notify:
     - Reload nginx for munin
   when: ${with_munin} and ${with_nginx}
 
 - name: Install nginx virtual host for munin (sites-enabled)
-  action: file src=/etc/nginx/sites-available/munin path=/etc/nginx/sites-enabled/munin state=link
+  file: src=/etc/nginx/sites-available/munin path=/etc/nginx/sites-enabled/munin state=link
   notify:
     - Reload nginx for munin
   when: ${with_munin} and ${with_nginx}
 
 - name: Install apache2 virtual host for munin (sites-available)
-  action: template src=munin/apache2_vhost.j2 dest=/etc/apache2/sites-available/munin owner=root group=root mode=0644
+  template: src=munin/apache2_vhost.j2 dest=/etc/apache2/sites-available/munin owner=root group=root mode=0644
   notify:
     - Reload apache2 for munin
   when: ${with_munin} and ${with_apache2}
 
 - name: Install apache2 virtual host for munin (sites-enabled)
-  action: file src=/etc/apache2/sites-available/munin path=/etc/apache2/sites-enabled/munin state=link
+  file: src=/etc/apache2/sites-available/munin path=/etc/apache2/sites-enabled/munin state=link
   notify:
     - Reload apache2 for munin
   when: ${with_munin} and ${with_apache2}
 
 - name: Ensure munin-node is running
-  action: service name=munin-node state=started
+  service: name=munin-node state=started
   when: ${with_munin_node}

+ 2 - 2
roles/webserver/handlers/apache2.yml

@@ -1,5 +1,5 @@
 - name: Reload apache2
-  action: service name=apache2 state=reloaded
+  service: name=apache2 state=reloaded
 
 - name: Restart apache2
-  action: service name=apache2 state=restarted
+  service: name=apache2 state=restarted

+ 2 - 2
roles/webserver/handlers/fpm.yml

@@ -1,5 +1,5 @@
 - name: Reload php5-fpm
-  action: service name=php5-fpm state=reloaded
+  service: name=php5-fpm state=reloaded
 
 - name: Restart php5-fpm
-  action: service name=php5-fpm state=restarted
+  service: name=php5-fpm state=restarted

+ 2 - 2
roles/webserver/handlers/nginx.yml

@@ -1,5 +1,5 @@
 - name: Reload nginx
-  action: service name=nginx state=reloaded
+  service: name=nginx state=reloaded
 
 - name: Restart nginx
-  action: service name=nginx state=restarted
+  service: name=nginx state=restarted

+ 9 - 9
roles/webserver/tasks/apache2.yml

@@ -1,45 +1,45 @@
 - name: Install apache2 packages
-  action: ${ansible_pkg_mgr} pkg=apache2 state=installed update_cache=yes
+  apt: pkg=apache2 state=installed update_cache=yes
   when: ${with_apache2}
 
 - name: Install apache2 basic security configuration
-  action: template src=apache2/conf.d/security.j2 dest=/etc/apache2/conf.d/security owner=root group=root mode=0644
+  template: src=apache2/conf.d/security.j2 dest=/etc/apache2/conf.d/security owner=root group=root mode=0644
   notify:
     - Reload apache2
   when: ${with_apache2}
 
 - name: Install mod_php5 packages for apache2
-  action: ${ansible_pkg_mgr} pkg=libapache2-mod-php5 state=installed update_cache=yes
+  apt: pkg=libapache2-mod-php5 state=installed update_cache=yes
   when: ${with_apache2} and ${with_apache2_modphp5}
 
 - name: Create basic authentication file for admin (apache2)
-  action: template src=apache2/auth_admin.j2 dest=/etc/apache2/auth_admin owner=root group=www-data mode=0640
+  template: src=apache2/auth_admin.j2 dest=/etc/apache2/auth_admin owner=root group=www-data mode=0640
   when: ${with_apache2}
 
 - name: Install PHPMyAdmin virtual host for apache2 (sites-available)
-  action: template src=apache2/pma_vhost.j2 dest=/etc/apache2/sites-available/pma owner=root group=root mode=0644
+  template: src=apache2/pma_vhost.j2 dest=/etc/apache2/sites-available/pma owner=root group=root mode=0644
   notify:
     - Reload apache2
   when: ${with_phpmyadmin} and ${with_apache2}
 
 - name: Install PHPMyAdmin virtual host for apache2 (sites-enabled)
-  action: file src=/etc/apache2/sites-available/pma path=/etc/apache2/sites-enabled/pma state=link
+  file: src=/etc/apache2/sites-available/pma path=/etc/apache2/sites-enabled/pma state=link
   notify:
     - Reload apache2
   when: ${with_phpmyadmin} and ${with_apache2}
 
 - name: Install PHP system checks virtual host for apache2 (sites-available)
-  action: template src=apache2/sys_vhost.j2 dest=/etc/apache2/sites-available/sys owner=root group=root mode=0644
+  template: src=apache2/sys_vhost.j2 dest=/etc/apache2/sites-available/sys owner=root group=root mode=0644
   notify:
     - Reload apache2
   when: ${with_php} and ${with_apache2}
 
 - name: Install PHP system checks virtual host for apache2 (sites-enabled)
-  action: file src=/etc/apache2/sites-available/sys path=/etc/apache2/sites-enabled/sys state=link
+  file: src=/etc/apache2/sites-available/sys path=/etc/apache2/sites-enabled/sys state=link
   notify:
     - Reload apache2
   when: ${with_php} and ${with_apache2}
 
 - name: Ensure apache2 is running
-  action: service name=apache2 state=started
+  service: name=apache2 state=started
   when: ${with_apache2}

+ 6 - 6
roles/webserver/tasks/fpm.yml

@@ -1,31 +1,31 @@
 - name: Install php5-fpm package
-  action: ${ansible_pkg_mgr} pkg=php5-fpm state=installed update_cache=yes
+  apt: pkg=php5-fpm state=installed update_cache=yes
   when: ${with_fpm}
 
 - name: Install php5-fpm init script config file
-  action: template src=fpm/default.j2 dest=/etc/default/php5-fpm owner=root group=root mode=0644
+  template: src=fpm/default.j2 dest=/etc/default/php5-fpm owner=root group=root mode=0644
   notify:
       - Restart php5-fpm
   when: ${with_fpm}
 
 - name: Install php5-fpm configuration file
-  action: template src=fpm/php-fpm-custom.conf.j2 dest=/etc/php5/fpm/php-fpm-custom.conf owner=root group=root mode=0644
+  template: src=fpm/php-fpm-custom.conf.j2 dest=/etc/php5/fpm/php-fpm-custom.conf owner=root group=root mode=0644
   notify:
       - Restart php5-fpm
   when: ${with_fpm}
 
 - name: Install nginx config files for php5-fpm (fpm servers pool)
-  action: template src=fpm/nginx/fpm-pool.conf.j2 dest=/etc/nginx/conf.d/fpm-pool.conf owner=root group=root mode=0644
+  template: src=fpm/nginx/fpm-pool.conf.j2 dest=/etc/nginx/conf.d/fpm-pool.conf owner=root group=root mode=0644
   notify:
       - Reload nginx
   when: ${with_fpm} and ${with_nginx}
 
 - name: Install nginx config files for php5-fpm (fpm fastcgi config)
-  action: template src=fpm/nginx/fastcgi_pass_fpm.j2 dest=/etc/nginx/fastcgi_pass_fpm owner=root group=root mode=0644
+  template: src=fpm/nginx/fastcgi_pass_fpm.j2 dest=/etc/nginx/fastcgi_pass_fpm owner=root group=root mode=0644
   notify:
       - Reload nginx
   when: ${with_fpm} and ${with_nginx}
 
 - name: Ensure php5-fpm is running
-  action: service name=php5-fpm state=started
+  service: name=php5-fpm state=started
   when: ${with_fpm}

+ 11 - 11
roles/webserver/tasks/nginx.yml

@@ -1,21 +1,21 @@
 - name: Install nginx package
-  action: ${ansible_pkg_mgr} pkg=nginx state=installed update_cache=yes
+  apt: pkg=nginx state=installed update_cache=yes
   when: ${with_nginx}
 
 - name: Install nginx default file configuration
-  action: template src=nginx/default.j2 dest=/etc/default/nginx owner=root group=root mode=0644
+  template: src=nginx/default.j2 dest=/etc/default/nginx owner=root group=root mode=0644
   notify:
     - Restart nginx
   when: ${with_nginx}
 
 - name: Install nginx configuration
-  action: template src=nginx/nginx.conf.j2 dest=/etc/nginx/nginx.conf owner=root group=root mode=0644
+  template: src=nginx/nginx.conf.j2 dest=/etc/nginx/nginx.conf owner=root group=root mode=0644
   notify:
     - Restart nginx
   when: ${with_nginx}
 
 - name: Install additional nginx configuration params (conf.d/)
-  action: template src=nginx/conf.d/${item}.conf.j2 dest=/etc/nginx/conf.d/${item}.conf owner=root group=root mode=0644
+  template: src=nginx/conf.d/${item}.conf.j2 dest=/etc/nginx/conf.d/${item}.conf owner=root group=root mode=0644
   with_items:
     - status
   notify:
@@ -23,7 +23,7 @@
   when: ${with_nginx}
 
 - name: Install additional nginx configuration params (vhost_*)
-  action: template src=nginx/vhost_${item}.j2 dest=/etc/nginx/vhost_${item} owner=root group=root mode=0644
+  template: src=nginx/vhost_${item}.j2 dest=/etc/nginx/vhost_${item} owner=root group=root mode=0644
   with_items:
     - all
     - expires
@@ -34,33 +34,33 @@
   when: ${with_nginx}
 
 - name: Create basic authentication file for admin (nginx)
-  action: template src=nginx/auth_admin.j2 dest=/etc/nginx/auth_admin owner=root group=www-data mode=0640
+  template: src=nginx/auth_admin.j2 dest=/etc/nginx/auth_admin owner=root group=www-data mode=0640
   when: ${with_nginx}
 
 - name: Install PHPMyAdmin virtual host for nginx (sites-available)
-  action: template src=nginx/pma_vhost.j2 dest=/etc/nginx/sites-available/pma owner=root group=root mode=0644
+  template: src=nginx/pma_vhost.j2 dest=/etc/nginx/sites-available/pma owner=root group=root mode=0644
   notify:
     - Reload nginx
   when: ${with_phpmyadmin} and ${with_nginx}
 
 - name: Install PHPMyAdmin virtual host for nginx (sites-enabled)
-  action: file src=/etc/nginx/sites-available/pma path=/etc/nginx/sites-enabled/pma state=link
+  file: src=/etc/nginx/sites-available/pma path=/etc/nginx/sites-enabled/pma state=link
   notify:
     - Reload nginx
   when: ${with_phpmyadmin} and ${with_nginx}
 
 - name: Install PHP system checks virtual host for nginx (sites-available)
-  action: template src=nginx/sys_vhost.j2 dest=/etc/nginx/sites-available/sys owner=root group=root mode=0644
+  template: src=nginx/sys_vhost.j2 dest=/etc/nginx/sites-available/sys owner=root group=root mode=0644
   notify:
     - Reload nginx
   when: ${with_php} and ${with_nginx}
 
 - name: Install PHP system checks virtual host for nginx (sites-enabled)
-  action: file src=/etc/nginx/sites-available/sys path=/etc/nginx/sites-enabled/sys state=link
+  file: src=/etc/nginx/sites-available/sys path=/etc/nginx/sites-enabled/sys state=link
   notify:
     - Reload nginx
   when: ${with_php} and ${with_nginx}
 
 - name: Ensure nginx is running
-  action: service name=nginx state=started
+  service: name=nginx state=started
   when: ${with_nginx}

+ 8 - 8
roles/webserver/tasks/php.yml

@@ -1,5 +1,5 @@
 - name: Install common PHP dependencies
-  action: ${ansible_pkg_mgr} pkg=${item} state=installed update_cache=yes
+  apt: pkg=${item} state=installed update_cache=yes
   with_items:
     - php5-cli
     - php5-curl
@@ -10,29 +10,29 @@
   when: ${with_php}
 
 - name: Instal local PHP configuration
-  action: template src=php/php-config.ini.j2 dest=/etc/php5/conf.d/99-local-config.ini owner=root group=root mode=0644
+  template: src=php/php-config.ini.j2 dest=/etc/php5/conf.d/99-local-config.ini owner=root group=root mode=0644
   when: ${with_php}
 
 - name: Create system checks directory /etc/php5/syscheck.d
-  action: file path=/etc/php5/syscheck.d owner=root group=root mode=0755 state=directory
+  file: path=/etc/php5/syscheck.d owner=root group=root mode=0755 state=directory
   when: ${with_php}
 
 - name: Install phpinfo system check
-  action: template src=php/phpinfo.php dest=/etc/php5/syscheck.d/index.php owner=root group=root mode=0644
+  template: src=php/phpinfo.php dest=/etc/php5/syscheck.d/index.php owner=root group=root mode=0644
   when: ${with_php}
 
 - name: Install PHP APC extension
-  action: ${ansible_pkg_mgr} pkg=php-apc state=installed update_cache=yes
+  apt: pkg=php-apc state=installed update_cache=yes
   when: ${with_php_apc}
 
 - name: Install php-apc system check
-  action: template src=php/apc.php dest=/etc/php5/syscheck.d/apc.php owner=root group=root mode=0644
+  template: src=php/apc.php dest=/etc/php5/syscheck.d/apc.php owner=root group=root mode=0644
   when: ${with_php_apc}
 
 - name: Install MySQL extension for PHP
-  action: ${ansible_pkg_mgr} pkg=php5-mysqlnd state=installed update_cache=yes
+  apt: pkg=php5-mysqlnd state=installed update_cache=yes
   when: ${with_mysql} and ${with_php}
 
 - name: Install PHPMyAdmin
-  action: ${ansible_pkg_mgr} pkg=phpmyadmin state=installed update_cache=yes
+  apt: pkg=phpmyadmin state=installed update_cache=yes
   when: ${with_phpmyadmin}