Commit dad53a9f authored by Dave Johnson's avatar Dave Johnson Committed by GitHub
Browse files

Merge pull request #143 from bbaassssiiee/master

ran ansible-lint: stripped trailing spaces
parents efa1eba7 036c3b81
---
- name: restart jboss
- name: restart jboss
service: name=jboss state=restarted
- name: restart iptables
......
......@@ -32,7 +32,7 @@
copy: src=jboss-as-standalone.sh dest=/etc/init.d/jboss mode=0755
- name: Enable JBoss to be started at boot
service: name=jboss enabled=yes state=started
service: name=jboss enabled=yes state=started
- name: deploy iptables rules
template: src=iptables-save dest=/etc/sysconfig/iptables
......
---
# This playbook deploys a simple standalone JBoss server.
# This playbook deploys a simple standalone JBoss server.
- hosts: jboss-servers
- hosts: jboss-servers
remote_user: root
roles:
......
......@@ -13,7 +13,7 @@
- name: Create the GPG key for EPEL
copy: src=RPM-GPG-KEY-EPEL-6 dest=/etc/pki/rpm-gpg
- name: install some useful nagios plugins
- name: install some useful nagios plugins
yum: name={{ item }} state=present
with_items:
- nagios-nrpe
......@@ -23,7 +23,7 @@
- nagios-plugins-load
- nagios-plugins-disk
- name: Install ntp
- name: Install ntp
yum: name=ntp state=present
tags: ntp
......
......@@ -13,7 +13,7 @@
- name: Create Mysql configuration file
template: src=my.cnf.j2 dest=/etc/my.cnf
notify:
notify:
- restart mysql
- name: Start Mysql Service
......
---
# handlers for nagios
# handlers for nagios
- name: restart httpd
service: name=httpd state=restarted
......
---
# This will install nagios
- name: install nagios
- name: install nagios
yum: pkg={{ item }} state=present
with_items:
- nagios
......
---
# httpd is handled by the base-apache role upstream
- name: Install php and git
- name: Install php and git
yum: name={{ item }} state=present
with_items:
- php
......
---
# This playbook deploys the whole application stack in this site.
# This playbook deploys the whole application stack in this site.
# Apply common configuration to all hosts
- hosts: all
......@@ -13,7 +13,7 @@
roles:
- db
# Configure and deploy the web servers. Note that we include two roles here,
# Configure and deploy the web servers. Note that we include two roles here,
# the 'base-apache' role which simply sets up Apache, and 'web' which includes
# our example web application.
- hosts: webservers
......
---
# This playbook contains common plays that will be run on all nodes.
- name: Install ntp
- name: Install ntp
yum: name=ntp state=present
tags: ntp
......
......@@ -15,7 +15,7 @@
- name: Create Mysql configuration file
template: src=my.cnf.j2 dest=/etc/my.cnf
notify:
notify:
- restart mysql
- name: Start Mysql Service
......
---
# These tasks are responsible for copying the latest dev/production code from
# the version control system.
# the version control system.
- name: Copy the code from repository
git: repo={{ repository }} dest=/var/www/html/
- name: Creates the index.php file
- name: Creates the index.php file
template: src=index.php.j2 dest=/var/www/html/index.php
......@@ -20,5 +20,5 @@
service: name=httpd state=started enabled=yes
- name: Configure SELinux to allow httpd to connect to remote database
seboolean: name=httpd_can_network_connect_db state=true persistent=yes
seboolean: name=httpd_can_network_connect_db state=true persistent=yes
when: sestatus.rc != 0
---
# This playbook deploys the whole application stack in this site.
# This playbook deploys the whole application stack in this site.
- name: apply common configuration to all nodes
hosts: all
......
---
# This playbook contains common plays that will be run on all nodes.
- name: Install ntp
- name: Install ntp
yum: name=ntp state=present
tags: ntp
......
......@@ -12,12 +12,12 @@
- name: Create Mysql configuration file
template: src=my.cnf.j2 dest=/etc/my.cnf
notify:
notify:
- restart mariadb
- name: Create MariaDB log file
file: path=/var/log/mysqld.log state=touch owner=mysql group=mysql mode=0775
- name: Create MariaDB PID directory
file: path=/var/run/mysqld state=directory owner=mysql group=mysql mode=0775
......
---
# These tasks are responsible for copying the latest dev/production code from
# the version control system.
# the version control system.
- name: Copy the code from repository
git: repo={{ repository }} dest=/var/www/html/
- name: Creates the index.php file
- name: Creates the index.php file
template: src=index.php.j2 dest=/var/www/html/index.php
---
# This playbook deploys the whole application stack in this site.
# This playbook deploys the whole application stack in this site.
- name: apply common configuration to all nodes
hosts: all
......
---
# this is a demo of conditional executions using 'when' statements, which can skip
# certain tasks on machines/platforms/etc where they do not apply.
# certain tasks on machines/platforms/etc where they do not apply.
- hosts: all
remote_user: root
......@@ -28,7 +28,7 @@
- name: "do this if I have one of these SSNs"
shell: /bin/true
when: ssn in [ 8675309, 8675310, 8675311 ]
- name: "do this if a variable named hippo is NOT defined"
shell: /bin/true
when: hippo is not defined
......
---
# this is an example of how we can perform actions on a given host on behalf of all the hosts
# in a play.
# in a play.
#
# The two main uses of this would be signalling an outage window for hosts that
# we are going to start upgrading, or to take a machine out of rotation by talking to a load
# balancer.
# balancer.
#
# This example cheats by replacing the load balancer script with the 'echo' command,
# leaving actual communication with the load balancer as an exercise to the reader. In reality,
# you could call anything you want, the main thing is that it should do something with
# you could call anything you want, the main thing is that it should do something with
# {{inventory_hostname}}
# NOTE: see batch_size_control.yml for an example of the 'serial' keyword, which you almost certainly
......@@ -20,19 +20,19 @@
serial: 5
tasks:
- name: take the machine out of rotation
command: echo taking out of rotation {{inventory_hostname}}
delegate_to: 127.0.0.1
# here's an alternate notation if you are delegating to 127.0.0.1, you can use 'local_action'
# here's an alternate notation if you are delegating to 127.0.0.1, you can use 'local_action'
# instead of 'action' and leave off the 'delegate_to' part.
#
# - local_action: command echo taking out of rotation {{inventory_hostname}}
- name: do several things on the actual host
command: echo hi mom {{inventory_hostname}}
- name: put machine back into rotation
command: echo inserting into rotation {{inventory_hostname}}
delegate_to: 127.0.0.1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment