Updates for style and 1.2 syntax

pull/63/head
Tim Gerla 11 years ago
parent bf7f9d5c65
commit 30a9693c4e
  1. 2
      lamp_haproxy/roles/base-apache/tasks/main.yml
  2. 2
      lamp_haproxy/roles/common/tasks/main.yml
  3. 6
      lamp_haproxy/roles/db/tasks/main.yml
  4. 2
      lamp_haproxy/roles/haproxy/tasks/main.yml
  5. 4
      lamp_haproxy/roles/nagios/tasks/main.yml
  6. 4
      lamp_haproxy/roles/web/tasks/main.yml
  7. 24
      lamp_haproxy/rolling_update.yml

@ -2,7 +2,7 @@
# This role installs httpd
- name: Install http and php etc
yum: name=$item state=installed
yum: name={{ item }} state=present
with_items:
- httpd
- libsemanage-python

@ -8,7 +8,7 @@
copy: src=RPM-GPG-KEY-EPEL-6 dest=/etc/pki/rpm-gpg
- name: install some useful nagios plugins
yum: name=$item state=present
yum: name={{ item }} state=present
with_items:
- nagios-nrpe
- nagios-plugins-swap

@ -2,7 +2,7 @@
# This role will install MySQL and create db user and give permissions.
- name: Install Mysql package
yum: pkg=$item state=installed
yum: name={{ item }} state=present
with_items:
- mysql-server
- MySQL-python
@ -21,7 +21,7 @@
service: name=mysqld state=started enabled=true
- name: Create Application Database
mysql_db: name=$dbname state=present
mysql_db: name={{ dbname }} state=present
- name: Create Application DB User
mysql_user: name=$dbuser password=$upassword priv=*.*:ALL host='%' state=present
mysql_user: name={{ dbuser }} password={{ upassword }} priv=*.*:ALL host='%' state=present

@ -2,7 +2,7 @@
# This role installs HAProxy and configures it.
- name: Download and install haproxy and socat
yum: name=$item state=installed
yum: name={{ item }} state=present
with_items:
- haproxy
- socat

@ -2,7 +2,7 @@
# This will install nagios
- name: install nagios
yum: pkg=$item state=installed
yum: pkg={{ item }} state=present
with_items:
- nagios
- nagios-plugins
@ -30,7 +30,7 @@
- name: create the nagios object files
template: src={{ item + ".j2" }}
dest=/etc/nagios/ansible-managed/{{ item }}
dest=/etc/nagios/ansible-managed/
with_items:
- webservers.cfg
- dbservers.cfg

@ -2,7 +2,7 @@
# httpd is handled by the base-apache role upstream
- name: Install php and git
yum: name=$item state=installed
yum: name={{ item }} state=present
with_items:
- php
- php-mysql
@ -12,4 +12,4 @@
seboolean: name=httpd_can_network_connect_db state=true persistent=yes
- name: Copy the code from repository
git: repo=${repository} version=${webapp_version} dest=/var/www/html/
git: repo={{ repository }} version={{ webapp_version }} dest=/var/www/html/

@ -18,14 +18,14 @@
# These are the tasks to run before applying updates:
pre_tasks:
- name: disable nagios alerts for this host webserver service
nagios: action=disable_alerts host=$ansible_hostname services=webserver
delegate_to: $item
with_items: ${groups.monitoring}
nagios: action=disable_alerts host={{ ansible_hostname }} services=webserver
delegate_to: "{{ item }}"
with_items: groups.monitoring
- name: disable the server in haproxy
shell: echo "disable server myapplb/${ansible_hostname}" | socat stdio /var/lib/haproxy/stats
delegate_to: $item
with_items: ${groups.lbservers}
shell: echo "disable server myapplb/{{ ansible_hostname }}" | socat stdio /var/lib/haproxy/stats
delegate_to: "{{ item }}"
with_items: groups.lbservers
roles:
- common
@ -35,11 +35,11 @@
# These tasks run after the roles:
post_tasks:
- name: Enable the server in haproxy
shell: echo "enable server myapplb/${ansible_hostname}" | socat stdio /var/lib/haproxy/stats
delegate_to: $item
with_items: ${groups.lbservers}
shell: echo "enable server myapplb/{{ ansible_hostname }}" | socat stdio /var/lib/haproxy/stats
delegate_to: "{{ item }}"
with_items: groups.lbservers
- name: re-enable nagios alerts
nagios: action=enable_alerts host=$ansible_hostname services=webserver
delegate_to: $item
with_items: ${groups.monitoring}
nagios: action=enable_alerts host={{ ansible_hostname }} services=webserver
delegate_to: "{{ item }}"
with_items: groups.monitoring