Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Mohamed Alibi
ansible-examples
Commits
dad53a9f
Commit
dad53a9f
authored
Jul 21, 2016
by
Dave Johnson
Committed by
GitHub
Jul 21, 2016
Browse files
Merge pull request #143 from bbaassssiiee/master
ran ansible-lint: stripped trailing spaces
parents
efa1eba7
036c3b81
Changes
45
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
33 additions
and
33 deletions
+33
-33
jboss-standalone/roles/jboss-standalone/handlers/main.yml
jboss-standalone/roles/jboss-standalone/handlers/main.yml
+1
-1
jboss-standalone/roles/jboss-standalone/tasks/main.yml
jboss-standalone/roles/jboss-standalone/tasks/main.yml
+1
-1
jboss-standalone/site.yml
jboss-standalone/site.yml
+2
-2
lamp_haproxy/roles/common/tasks/main.yml
lamp_haproxy/roles/common/tasks/main.yml
+2
-2
lamp_haproxy/roles/db/tasks/main.yml
lamp_haproxy/roles/db/tasks/main.yml
+1
-1
lamp_haproxy/roles/nagios/handlers/main.yml
lamp_haproxy/roles/nagios/handlers/main.yml
+1
-1
lamp_haproxy/roles/nagios/tasks/main.yml
lamp_haproxy/roles/nagios/tasks/main.yml
+1
-1
lamp_haproxy/roles/web/tasks/main.yml
lamp_haproxy/roles/web/tasks/main.yml
+1
-1
lamp_haproxy/site.yml
lamp_haproxy/site.yml
+2
-2
lamp_simple/roles/common/tasks/main.yml
lamp_simple/roles/common/tasks/main.yml
+1
-1
lamp_simple/roles/db/tasks/main.yml
lamp_simple/roles/db/tasks/main.yml
+1
-1
lamp_simple/roles/web/tasks/copy_code.yml
lamp_simple/roles/web/tasks/copy_code.yml
+2
-2
lamp_simple/roles/web/tasks/install_httpd.yml
lamp_simple/roles/web/tasks/install_httpd.yml
+1
-1
lamp_simple/site.yml
lamp_simple/site.yml
+1
-1
lamp_simple_rhel7/roles/common/tasks/main.yml
lamp_simple_rhel7/roles/common/tasks/main.yml
+1
-1
lamp_simple_rhel7/roles/db/tasks/main.yml
lamp_simple_rhel7/roles/db/tasks/main.yml
+3
-3
lamp_simple_rhel7/roles/web/tasks/copy_code.yml
lamp_simple_rhel7/roles/web/tasks/copy_code.yml
+2
-2
lamp_simple_rhel7/site.yml
lamp_simple_rhel7/site.yml
+1
-1
language_features/conditionals_part2.yml
language_features/conditionals_part2.yml
+2
-2
language_features/delegation.yml
language_features/delegation.yml
+6
-6
No files found.
jboss-standalone/roles/jboss-standalone/handlers/main.yml
View file @
dad53a9f
---
-
name
:
restart jboss
-
name
:
restart jboss
service
:
name=jboss state=restarted
-
name
:
restart iptables
...
...
jboss-standalone/roles/jboss-standalone/tasks/main.yml
View file @
dad53a9f
...
...
@@ -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
...
...
jboss-standalone/site.yml
View file @
dad53a9f
---
# 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
:
...
...
lamp_haproxy/roles/common/tasks/main.yml
View file @
dad53a9f
...
...
@@ -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
...
...
lamp_haproxy/roles/db/tasks/main.yml
View file @
dad53a9f
...
...
@@ -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
...
...
lamp_haproxy/roles/nagios/handlers/main.yml
View file @
dad53a9f
---
# handlers for nagios
# handlers for nagios
-
name
:
restart httpd
service
:
name=httpd state=restarted
...
...
lamp_haproxy/roles/nagios/tasks/main.yml
View file @
dad53a9f
---
# This will install nagios
-
name
:
install nagios
-
name
:
install nagios
yum
:
pkg={{ item }} state=present
with_items
:
-
nagios
...
...
lamp_haproxy/roles/web/tasks/main.yml
View file @
dad53a9f
---
# 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
...
...
lamp_haproxy/site.yml
View file @
dad53a9f
---
# 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
...
...
lamp_simple/roles/common/tasks/main.yml
View file @
dad53a9f
---
# 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
...
...
lamp_simple/roles/db/tasks/main.yml
View file @
dad53a9f
...
...
@@ -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
...
...
lamp_simple/roles/web/tasks/copy_code.yml
View file @
dad53a9f
---
# 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
lamp_simple/roles/web/tasks/install_httpd.yml
View file @
dad53a9f
...
...
@@ -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
lamp_simple/site.yml
View file @
dad53a9f
---
# 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
...
...
lamp_simple_rhel7/roles/common/tasks/main.yml
View file @
dad53a9f
---
# 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
...
...
lamp_simple_rhel7/roles/db/tasks/main.yml
View file @
dad53a9f
...
...
@@ -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
...
...
lamp_simple_rhel7/roles/web/tasks/copy_code.yml
View file @
dad53a9f
---
# 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
lamp_simple_rhel7/site.yml
View file @
dad53a9f
---
# 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
...
...
language_features/conditionals_part2.yml
View file @
dad53a9f
---
# 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
...
...
language_features/delegation.yml
View file @
dad53a9f
---
# 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
...
...
Prev
1
2
3
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment