Compare commits

..

49 Commits

Author SHA1 Message Date
91acf65a52 Added all 2026-05-27 12:16:57 +02:00
3fe81f42a2 Added all 2026-05-27 12:11:32 +02:00
aaae16f141 Added all 2026-05-27 11:50:52 +02:00
afbe9fafee Added all 2026-05-27 11:46:15 +02:00
93a9b18cb7 added all 2026-05-27 11:41:50 +02:00
e6d32540ef import_playbook 2026-05-19 18:53:47 +02:00
4ffc84f786 hosts 2026-05-19 17:19:50 +02:00
0593ae6310 import_playbook 2026-05-19 17:18:19 +02:00
613e6be0f8 034_rols 2026-05-19 16:17:27 +02:00
16266c1a18 Added site.yml 2026-05-14 19:44:44 +02:00
ac2f836117 python home 2026-05-14 18:25:34 +02:00
7dcda52588 source 2026-05-14 18:20:30 +02:00
ab22558e14 creates venv 2026-05-14 18:13:47 +02:00
47cbd68739 webserver 2026-05-14 18:07:06 +02:00
fe74206930 remove virtualenv 2026-05-14 18:04:14 +02:00
4ce18f3889 sudo venv 2026-05-14 17:59:00 +02:00
e9fda294b2 bin bash 2026-05-14 17:48:28 +02:00
0ce169d569 python3-venv 2026-05-14 17:44:17 +02:00
554488ea14 site finished 2026-05-14 17:17:42 +02:00
873cdaa756 not in 2026-05-14 17:11:56 +02:00
559e7ae3d3 item item item content 2026-05-14 17:09:59 +02:00
45d8444aa5 Concatenació de cadenes 2026-05-14 17:06:10 +02:00
d39cbd6fcb Stack status 2026-05-14 17:03:29 +02:00
49da229a98 double quotes 2026-05-14 17:01:51 +02:00
38b476fc1a stack status 2026-05-14 17:00:55 +02:00
7f536273d9 stack status 2026-05-14 16:59:37 +02:00
5d18e93a98 revert hosts 2026-05-14 16:51:42 +02:00
444094781b example hosts 2026-05-14 16:50:48 +02:00
21c9ce145f Greenlet version 2026-05-14 16:34:23 +02:00
af6fcca768 Source venv 2026-05-14 16:31:10 +02:00
3e631906c1 Init virtualenv 2026-05-14 16:28:12 +02:00
670fca8aed Alguns rols 2026-05-14 16:21:10 +02:00
d455c1e765 mysqld 2026-05-12 18:58:23 +02:00
0d54576660 mysql-server-8.0 2026-05-12 18:47:34 +02:00
c66143ca34 mysql status 2026-05-12 18:45:16 +02:00
8f477950d8 Petit stack 2026-05-12 18:38:47 +02:00
52e636b8e5 Handlers 2026-05-12 17:48:29 +02:00
0ef9103ec3 Stack Status 2026-05-12 17:19:55 +02:00
8ae6813615 gather facts 2026-05-12 17:11:22 +02:00
fe6e91d8e4 hostname gathering facts 2026-05-12 17:06:26 +02:00
f0d9bdd6f8 services 2026-05-12 16:55:19 +02:00
a5bfb18c33 python3-pip-whl webserver with_items 2026-05-12 16:45:23 +02:00
2abb4d7d57 with_items hosts 2026-05-12 16:38:54 +02:00
f4fb1f178a Petit canvi a hosts de 002_example 2026-05-12 16:12:40 +02:00
4e35138e6d dpkg-reconfigure 2026-05-07 17:42:38 +02:00
7da40dce19 apt yes 2026-05-07 17:15:03 +02:00
4103845e98 Added apt 2026-05-07 16:51:47 +02:00
837aa86a8d apt curl vim 2026-05-07 16:50:28 +02:00
473f98bfd7 Falta absent 2026-05-07 16:08:33 +02:00
124 changed files with 1564 additions and 656 deletions

BIN
Ansible.pdf Normal file

Binary file not shown.

9
UbuntuAnsible.sh Normal file
View File

@@ -0,0 +1,9 @@
# Script to install Ansible on a Ubuntu system
apt-get update
# Install required packages
apt install software-properties-common -y
# Add Ansible PPA and install Ansible
apt-add-repository ppa:ansible/ansible
apt-get install ansible net-tools -y
# Add vagrant user to sudoers
echo "vagrant ALL=(ALL) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/vagrant

56
UbuntuVagrantfile Normal file
View File

@@ -0,0 +1,56 @@
Vagrant.configure(2) do |config|
# Máquina de control para el agente Ansible
config.vm.define "ansible" do |ansible|
ansible.vm.box = "bento/ubuntu-24.04" # Imagen base Ubuntu 24.04
ansible.vm.network "private_network", ip: "192.168.11.10" # IP privada
ansible.vm.hostname = "ansible" # Nombre de host
ansible.vm.synced_folder ".", "/home/vagrant/sync", type: "rsync" # Carpeta sincronizada
ansible.vm.provider "virtualbox" do |vb|
vb.memory = 512 # Memoria RAM asignada
vb.cpus = 1 # Número de CPUs asignadas
end
ansible.vm.provision :shell, :path => "ansible.sh" # Script de aprovisionamiento
end
# Máquina para la base de datos
config.vm.define "database" do |database|
database.vm.box = "bento/ubuntu-24.04"
database.vm.network "private_network", ip: "192.168.11.20"
database.vm.hostname = "database"
database.vm.synced_folder ".", "/home/vagrant/sync", type: "rsync"
database.vm.network "forwarded_port", guest: 80, host: 8081 # Redirección del puerto 80
database.vm.network "forwarded_port", guest: 3306, host: 3306 # Redirección del puerto MySQL
database.vm.provider "virtualbox" do |vb|
vb.memory = 512
vb.cpus = 1
end
end
# Máquina para el balanceador de carga
config.vm.define "loadbalancer" do |loadbalancer|
loadbalancer.vm.box = "bento/ubuntu-24.04"
loadbalancer.vm.network "private_network", ip: "192.168.11.30"
loadbalancer.vm.hostname = "loadbalancer"
loadbalancer.vm.synced_folder ".", "/home/vagrant/sync", type: "rsync"
loadbalancer.vm.network "forwarded_port", guest: 80, host: 8080 # Redirección del puerto 80
loadbalancer.vm.network "forwarded_port", guest: 3306, host: 33061 # Redirección del puerto MySQL alternativo
loadbalancer.vm.provider "virtualbox" do |vb|
vb.memory = 512
vb.cpus = 1
end
end
# Máquina para el servidor web
config.vm.define "webserver" do |webserver|
webserver.vm.box = "bento/ubuntu-24.04"
webserver.vm.network "private_network", ip: "192.168.11.40"
webserver.vm.hostname = "webserver"
webserver.vm.synced_folder ".", "/home/vagrant/sync", type: "rsync"
webserver.vm.network "forwarded_port", guest: 80, host: 80 # Redirección del puerto 80
webserver.vm.network "forwarded_port", guest: 3306, host: 33062 # Redirección del puerto MySQL alternativo
webserver.vm.provider "virtualbox" do |vb|
vb.memory = 512
vb.cpus = 1
end
end
end

8
Vagrantfile vendored
View File

@@ -1,7 +1,7 @@
Vagrant.configure(2) do |config|
# Máquina de control para el agente Ansible
config.vm.define "ansible" do |ansible|
ansible.vm.box = "bento/ubuntu-24.04" # Imagen base Ubuntu 24.04
ansible.vm.box = "bento/debian-13.1" # Imagen base Ubuntu 24.04
ansible.vm.network "private_network", ip: "192.168.11.10" # IP privada
ansible.vm.hostname = "ansible" # Nombre de host
ansible.vm.synced_folder ".", "/home/vagrant/sync", type: "rsync" # Carpeta sincronizada
@@ -14,7 +14,7 @@ Vagrant.configure(2) do |config|
# Máquina para la base de datos
config.vm.define "database" do |database|
database.vm.box = "bento/ubuntu-24.04"
database.vm.box = "bento/debian-13.1"
database.vm.network "private_network", ip: "192.168.11.20"
database.vm.hostname = "database"
database.vm.synced_folder ".", "/home/vagrant/sync", type: "rsync"
@@ -28,7 +28,7 @@ Vagrant.configure(2) do |config|
# Máquina para el balanceador de carga
config.vm.define "loadbalancer" do |loadbalancer|
loadbalancer.vm.box = "bento/ubuntu-24.04"
loadbalancer.vm.box = "bento/debian-13.1"
loadbalancer.vm.network "private_network", ip: "192.168.11.30"
loadbalancer.vm.hostname = "loadbalancer"
loadbalancer.vm.synced_folder ".", "/home/vagrant/sync", type: "rsync"
@@ -42,7 +42,7 @@ Vagrant.configure(2) do |config|
# Máquina para el servidor web
config.vm.define "webserver" do |webserver|
webserver.vm.box = "bento/ubuntu-24.04"
webserver.vm.box = "bento/debian-13.1"
webserver.vm.network "private_network", ip: "192.168.11.40"
webserver.vm.hostname = "webserver"
webserver.vm.synced_folder ".", "/home/vagrant/sync", type: "rsync"

View File

@@ -1,9 +1,6 @@
# Script to install Ansible on a Ubuntu system
apt-get update
# Install required packages
apt install software-properties-common -y
# Add Ansible PPA and install Ansible
apt-add-repository ppa:ansible/ansible
# Add Ansible repository and install Ansible
apt-get install ansible net-tools -y
# Add vagrant user to sudoers
echo "vagrant ALL=(ALL) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/vagrant

View File

@@ -1,3 +0,0 @@
---
httpd_port: 80
ntpserver: 192.168.0.2

View File

@@ -1,7 +0,0 @@
iface: '{{ ansible_default_ipv4.interface }}'
apache_test_message: hello world
apache_max_keep_alive_requests: 113
apache_docroot: /var/www/html
sites_available: /etc/httpd/conf/sites-available
sites_enabled: /etc/httpd/conf/sites-enabled
lameapp_version: 1

View File

@@ -1,2 +0,0 @@
[webservers]
192.168.0.2

View File

@@ -1,2 +0,0 @@
---
# defaults file for apache

View File

@@ -1,4 +0,0 @@
---
# handlers file for apache
- name: restart apache
service: name=apache2 state=restarted

View File

@@ -1,57 +0,0 @@
galaxy_info:
author: your name
description: your description
company: your company (optional)
# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
# issue_tracker_url: http://example.com/issue/tracker
# Some suggested licenses:
# - BSD (default)
# - MIT
# - GPLv2
# - GPLv3
# - Apache
# - CC-BY
license: license (GPLv2, CC-BY, etc)
min_ansible_version: 1.2
# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:
# Optionally specify the branch Galaxy will use when accessing the GitHub
# repo for this role. During role install, if no tags are available,
# Galaxy will use this branch. During import Galaxy will access files on
# this branch. If Travis integration is configured, only notifications for this
# branch will be accepted. Otherwise, in all cases, the repo's default branch
# (usually master) will be used.
#github_branch:
#
# platforms is a list of platforms, and each platform has a name and a list of versions.
#
# platforms:
# - name: Fedora
# versions:
# - all
# - 25
# - name: SomePlatform
# versions:
# - all
# - 1.0
# - 7
# - 99.99
galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes
# and categorizes the role. Users find roles by searching for tags. Be sure to
# remove the '[]' above, if you add tags to this list.
#
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role.
dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.

View File

@@ -1,19 +0,0 @@
---
# tasks file for apache
- name: install apache
apt: name=apache2 state=present update-cache=yes
- name: copy index.html
template:
src: index.html.j2
dest: /var/www/html/index.html
- name: copy httpd conf
template:
src: httpd.conf.j2
dest: /etc/apache2
notify: restart apache
- name: start apache
service:
name: apache2 state=started enabled=yes

View File

@@ -1,225 +0,0 @@
# {{ ansible_managed }}
# This is the main Apache server configuration file. It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.4/ for detailed information about
# the directives and /usr/share/doc/apache2/README.Debian about Debian specific
# hints.
#
#
# Summary of how the Apache 2 configuration works in Debian:
# The Apache 2 web server configuration in Debian is quite different to
# upstream's suggested way to configure the web server. This is because Debian's
# default Apache2 installation attempts to make adding and removing modules,
# virtual hosts, and extra configuration directives as flexible as possible, in
# order to make automating the changes and administering the server as easy as
# possible.
ServerName {{ apache2_server_name|default(ansible_fqdn) }}
# It is split into several files forming the configuration hierarchy outlined
# below, all located in the /etc/apache2/ directory:
#
# /etc/apache2/
# |-- apache2.conf
# | `-- ports.conf
# |-- mods-enabled
# | |-- *.load
# | `-- *.conf
# |-- conf-enabled
# | `-- *.conf
# `-- sites-enabled
# `-- *.conf
#
#
# * apache2.conf is the main configuration file (this file). It puts the pieces
# together by including all remaining configuration files when starting up the
# web server.
#
# * ports.conf is always included from the main configuration file. It is
# supposed to determine listening ports for incoming connections which can be
# customized anytime.
#
# * Configuration files in the mods-enabled/, conf-enabled/ and sites-enabled/
# directories contain particular configuration snippets which manage modules,
# global configuration fragments, or virtual host configurations,
# respectively.
#
# They are activated by symlinking available configuration files from their
# respective *-available/ counterparts. These should be managed by using our
# helpers a2enmod/a2dismod, a2ensite/a2dissite and a2enconf/a2disconf. See
# their respective man pages for detailed information.
#
# * The binary is called apache2. Due to the use of environment variables, in
# the default configuration, apache2 needs to be started/stopped with
# /etc/init.d/apache2 or apache2ctl. Calling /usr/bin/apache2 directly will not
# work with the default configuration.
# Global configuration
#
#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# NOTE! If you intend to place this on an NFS (or otherwise network)
# mounted filesystem then please read the Mutex documentation (available
# at <URL:http://httpd.apache.org/docs/2.4/mod/core.html#mutex>);
# you will save yourself a lot of trouble.
#
# Do NOT add a slash at the end of the directory path.
#
#ServerRoot "/etc/apache2"
#
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
#
Mutex file:${APACHE_LOCK_DIR} default
#
# PidFile: The file in which the server should record its process
# identification number when it starts.
# This needs to be set in /etc/apache2/envvars
#
PidFile ${APACHE_PID_FILE}
#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300
#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On
#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100
#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 5
# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
#
# HostnameLookups: Log the names of clients or just their IP addresses
# e.g., www.apache.org (on) or 204.62.129.132 (off).
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on, since enabling it means that
# each client request will result in AT LEAST one lookup request to the
# nameserver.
#
HostnameLookups Off
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here. If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog ${APACHE_LOG_DIR}/error.log
#
# LogLevel: Control the severity of messages logged to the error_log.
# Available values: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the log level for particular modules, e.g.
# "LogLevel info ssl:warn"
#
LogLevel warn
# Include module configuration:
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf
# Include list of ports to listen on
Include ports.conf
# Sets the default security model of the Apache2 HTTPD server. It does
# not allow access to the root filesystem outside of /usr/share and /var/www.
# The former is used by web applications packaged in Debian,
# the latter may be used for local directories served by the web server. If
# your system is serving content from a sub-directory in /srv you must allow
# access here, or in any related virtual host.
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/>
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>
#<Directory /srv/>
# Options Indexes FollowSymLinks
# AllowOverride None
# Require all granted
#</Directory>
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives. See also the AllowOverride
# directive.
#
AccessFileName .htaccess
#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<FilesMatch "^\.ht">
Require all denied
</FilesMatch>
#
# The following directives define some format nicknames for use with
# a CustomLog directive.
#
# These deviate from the Common Log Format definitions in that they use %O
# (the actual bytes sent including headers) instead of %b (the size of the
# requested file), because the latter makes it impossible to detect partial
# requests.
#
# Note that the use of %{X-Forwarded-For}i instead of %h is not recommended.
# Use mod_remoteip instead.
#
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
# Include of directories ignores editors' and dpkg's backup files,
# see README.Debian for details.
# Include generic snippets of statements
IncludeOptional conf-enabled/*.conf
# Include the virtual host configurations:
IncludeOptional sites-enabled/*.conf
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

View File

@@ -1,6 +0,0 @@
{{ apache_test_message }} {{ ansible_distribution }} {{ ansible_distribution_version }} <br>
Current Host: {{ ansible_hostname }} <br>
Server list: <br>
{% for host in groups.webservers %}
{{ host }} <br>
{% endfor %}

View File

@@ -1,2 +0,0 @@
localhost

View File

@@ -1,5 +0,0 @@
---
- hosts: webservers
remote_user: root
roles:
- apache

View File

@@ -1,2 +0,0 @@
---
# vars file for apache

View File

@@ -1,2 +0,0 @@
---
# defaults file for common

View File

@@ -1,4 +0,0 @@
---
# handlers file for common
- name: restart ntp
service: name=ntpd state=restarted

View File

@@ -1,57 +0,0 @@
galaxy_info:
author: your name
description: your description
company: your company (optional)
# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
# issue_tracker_url: http://example.com/issue/tracker
# Some suggested licenses:
# - BSD (default)
# - MIT
# - GPLv2
# - GPLv3
# - Apache
# - CC-BY
license: license (GPLv2, CC-BY, etc)
min_ansible_version: 1.2
# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:
# Optionally specify the branch Galaxy will use when accessing the GitHub
# repo for this role. During role install, if no tags are available,
# Galaxy will use this branch. During import Galaxy will access files on
# this branch. If Travis integration is configured, only notifications for this
# branch will be accepted. Otherwise, in all cases, the repo's default branch
# (usually master) will be used.
#github_branch:
#
# platforms is a list of platforms, and each platform has a name and a list of versions.
#
# platforms:
# - name: Fedora
# versions:
# - all
# - 25
# - name: SomePlatform
# versions:
# - all
# - 1.0
# - 7
# - 99.99
galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes
# and categorizes the role. Users find roles by searching for tags. Be sure to
# remove the '[]' above, if you add tags to this list.
#
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role.
dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.

View File

@@ -1,9 +0,0 @@
---
# tasks file for common
- name: install epel repo
apt:
name: epel-release
state: present
- include: selinux.yml
- include: ntp.yml

View File

@@ -1,15 +0,0 @@
---
- name: install ntp
apt:
name: ntp
state: present
- name: configure ntp file
template:
src: ntp.conf.j2
dest: /etc/ntp.conf
- name: start ntp
service:
name: ntpd
state: started

View File

@@ -1,13 +0,0 @@
---
- name: install python bindings for SELinux
apt:
name: {{item}}
state: present
with_items:
- libselinux-python
- libsemanage-python
- name: test to see if SELinux is running
command: getenforce
register: sestatus
changed_when: false

View File

@@ -1,7 +0,0 @@
driftfile /var/lib/ntp/drift
restrict 127.0.0.1
restrict -6 ::1
server {{ ntpserver }}
includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys

View File

@@ -1,2 +0,0 @@
localhost

View File

@@ -1,5 +0,0 @@
---
- hosts: localhost
remote_user: root
roles:
- common

View File

@@ -1,2 +0,0 @@
---
# vars file for common

View File

@@ -1,7 +0,0 @@
---
- name: install and start apache
hosts: webservers
remote_user: root
become: yes
roles:
- apache

View File

@@ -0,0 +1,8 @@
---
- hosts: all
tasks:
- name: get server hostname
command: hostname
- name: Debug hostname
ansible.builtin.debug:
var: ansible_facts['hostname']

View File

@@ -1,4 +0,0 @@
---
- hosts: all
tasks:
- command: hostname

View File

@@ -1,19 +1,8 @@
[database]
192.168.0.2
192.168.0.3
192.168.11.20
[loadbalancer]
192.168.0.3
192.168.0.4
192.168.11.30
[webserver]
192.168.0.4
[alfa]
192.168.0.2
[bravo]
192.168.0.3
[charlie]
192.168.0.4
192.168.11.40

View File

@@ -1,12 +0,0 @@
[loadbalancer]
lb01 ansible_connection=local
[webserver]
app01 ansible_connection=local
app02 ansible_connection=local
[database]
db01 ansible_connection=local
[control]
control ansible_connection=local

View File

@@ -1,5 +0,0 @@
---
- hosts: all
tasks:
- name: get server hostname
command: hostname

View File

@@ -1,12 +0,0 @@
[loadbalancer]
lb01
[webserver]
app01
app02
[database]
db01
[control]
control ansible_connection=local

View File

@@ -1,5 +1,8 @@
[database]
192.168.0.2
192.168.11.20
[loadbalancer]
192.168.0.3
192.168.11.30
[webserver]
192.168.11.40

View File

@@ -2,5 +2,5 @@
- hosts: database
become: true
tasks:
- name: install mysql-server
apt: name=mysql-server state=present update_cache=yes
- name: install default-mysql-server
apt: name=default-mysql-server state=present update_cache=yes

View File

@@ -1,5 +0,0 @@
---
- hosts: all
tasks:
- name: get server hostname
command: hostname

View File

@@ -1,8 +1,8 @@
[database]
192.168.0.2
192.168.11.20
[loadbalancer]
192.168.0.3
192.168.11.30
[webserver]
192.168.0.4
192.168.11.40

View File

@@ -2,5 +2,5 @@
- hosts: database
become: true
tasks:
- name: install mysql-server
apt: name=mysql-server state=present update_cache=yes
- name: install default-mysql-server
apt: name=default-mysql-server state=present update_cache=yes

View File

@@ -1,5 +0,0 @@
---
- hosts: all
tasks:
- name: get server hostname
command: hostname

View File

@@ -0,0 +1,8 @@
[database]
192.168.11.20
[loadbalancer]
192.168.11.30
[webserver]
192.168.11.40

View File

@@ -7,6 +7,5 @@
with_items:
- apache2
- libapache2-mod-wsgi-py3
- python-pip-whl
- python3-pip-whl
- python3-virtualenv

View File

@@ -1,8 +0,0 @@
---
- hosts: control
become: true
tasks:
- name: install tools
apt: name={{item}} state=present update_cache=yes
with_items:
- uacme

View File

@@ -2,8 +2,8 @@
- hosts: database
become: true
tasks:
- name: install mysql-server
apt: name=mysql-server state=present update_cache=yes
- name: install default-mysql-server
apt: name=default-mysql-server state=present update_cache=yes
- name: ensure mysql started
service: name=mysql state=started enabled=yes

View File

@@ -0,0 +1,8 @@
[database]
192.168.11.20
[loadbalancer]
192.168.11.30
[webserver]
192.168.11.40

View File

@@ -1,5 +1,15 @@
---
- hosts: all
gather_facts: true
tasks:
- name: mostrar tots el gather facts
debug:
var: ansible_facts
- name: get server hostname
command: hostname
- name: mostrar IP del host
debug:
msg: "IP: {{ ansible_default_ipv4.address }}"
- name: mostrar hostname
debug:
msg: "Host: {{ ansible_hostname }}"

View File

@@ -1,17 +0,0 @@
---
- hosts: database
become: true
tasks:
- name: reiniciar mysql
service: name=mysql state=restarted
- hosts: loadbalancer
become: true
tasks:
- name: reiniciar nginx
service: name=nginx state=restarted
- hosts: webserver
become: true
tasks:
service: name=apache2 state=restarted

View File

@@ -0,0 +1,27 @@
---
- hosts: loadbalancer
become: true
tasks:
- name: verify nginx service
command: service nginx status
- name: verify nginx is listening on 80
wait_for: port=80 timeout=1
- hosts: webserver
become: true
tasks:
- name: verify apache2 service
command: service apache2 status
- name: verify apache2 is listening on 80
wait_for: port=80 timeout=1
- hosts: database
become: true
tasks:
- name: verify mysql service
command: service mysql status
- name: verify mysql is listening on 3306
wait_for: port=3306 timeout=1

View File

@@ -0,0 +1,5 @@
---
- ansible.builtin.import_playbook: database.yml
- ansible.builtin.import_playbook: webserver.yml
- ansible.builtin.import_playbook: loadbalancer.yml
- ansible.builtin.import_playbook: playbooks/stack_status.yml

View File

@@ -7,7 +7,7 @@
with_items:
- apache2
- libapache2-mod-wsgi-py3
- python-pip-whl
- python3-pip-whl
- python3-virtualenv
- name: ensure apache2 started

View File

@@ -2,8 +2,8 @@
- hosts: database
become: true
tasks:
- name: install mysql-server
apt: name=mysql-server state=present update_cache=yes
- name: install default-mysql-server
apt: name=default-mysql-server state=present update_cache=yes
- name: ensure mysql started
service: name=mysql state=started enabled=yes

View File

@@ -0,0 +1,11 @@
[control]
192.168.11.10
[database]
192.168.11.20
[loadbalancer]
192.168.11.30
[webserver]
192.168.11.40

View File

@@ -0,0 +1,8 @@
[database]
192.168.11.20
[loadbalancer]
192.168.11.30
[webserver]
192.168.11.40

View File

@@ -7,7 +7,7 @@
with_items:
- apache2
- libapache2-mod-wsgi-py3
- python-pip-whl
- python3-pip-whl
- python3-virtualenv
- name: ensure apache2 started

View File

@@ -1,6 +1,3 @@
activate_this = '/var/www/demo/.venv/bin/activate_this.py'
exec(open(activate_this).read(), {'__file__': activate_this})
import os
os.environ['DATABASE_URI'] = 'mysql://demo:demo@db01/demo'

View File

@@ -1,7 +1,7 @@
click==7.1.2
Flask==1.1.4
Flask-SQLAlchemy==2.5.1
greenlet==1.1.2
greenlet==3.5.0
itsdangerous==1.1.0
Jinja2==2.11.3
MarkupSafe==2.0.1

View File

@@ -1,6 +1,7 @@
<VirtualHost *>
WSGIDaemonProcess demo threads=5
WSGIScriptAlias / /var/www/demo/demo.wsgi
WSGIDaemonProcess demo python-home=/var/www/demo/.venv python-path=/var/www/demo
WSGIProcessGroup demo
<Directory /var/www/demo>
WSGIProcessGroup demo

View File

@@ -0,0 +1,11 @@
[control]
192.168.11.10
[database]
192.168.11.20
[loadbalancer]
192.168.11.30
[webserver]
192.168.11.40

View File

@@ -4,8 +4,8 @@
tasks:
- name: install tools
apt: name={{item}} state=present update_cache=yes
with_items:
- python-httplib2
loop:
- python3-httplib2
- name: install nginx
apt: name=nginx state=present update_cache=yes

View File

@@ -1,5 +1,11 @@
---
- hosts: all
tasks:
- name: get server hostname
- name: Ping to servers
ping:
- name: Get hostname
command: hostname
register: hostname
- name: Show hostname with message
debug:
msg: "The hostname of this server is {{ hostname.stdout }}"

View File

@@ -26,42 +26,45 @@
- name: verify mysql is listening on 3306
wait_for: port=3306 timeout=1
- hosts: control
tasks:
- name: verify end-to-end index response
uri: url=http://{{item}} return_content=yes
with_items: groups.loadbalancer
register: lb_index
- fail: msg="index failed to return content"
when: "'Hello, from sunny' not in item.content"
with_items: "{{lb_index.results}}"
- name: verify end-to-end db response
uri: url=http://{{item}}/db return_content=yes
with_items: groups.loadbalancer
register: lb_db
- fail: msg="db failed to return content"
when: "'Database Connected from' not in item.content"
with_items: "{{lb_db.results}}"
- hosts: loadbalancer
tasks:
- name: verify backend index response
uri: url=http://{{item}} return_content=yes
with_items: groups.webserver
loop: "{{ groups.webserver }}"
register: app_index
- fail: msg="index failed to return content"
when: "'Hello, from sunny {{item.item}}!' not in item.content"
with_items: "{{app_index.results}}"
when: ("Hello, from sunny " ~ item.content ~ "!") in item.content
loop: "{{app_index.results}}"
- name: verify backend db response
uri: url=http://{{item}}/db return_content=yes
with_items: groups.webserver
loop: "{{ groups.webserver }}"
register: app_db
- fail: msg="db failed to return content"
when: "'Database Connected from {{item.item}}!' not in item.content"
with_items: "{{app_db.results}}"
when: ("Database Connected from " ~ item.content ~ "!") in item.content
loop: "{{app_db.results}}"
- hosts: control
tasks:
- name: get elements from loadbalancer group
debug: var=groups.loadbalancer
- name: verify end-to-end connectivity to loadbalancer
uri: url=http://{{item}} return_content=yes
loop: "{{ groups.loadbalancer }}"
register: lb_connectivity
- fail: msg="index failed to return content"
when: ("Hello, from sunny " ~ item.content ~ "!") in item.content
loop: "{{lb_connectivity.results}}"
- name: verify end-to-end db response
uri: url=http://{{item}}/db return_content=yes
loop: "{{ groups.loadbalancer }}"
register: lb_db
- fail: msg="db failed to return content"
when: ("Database Connected from " ~ item.content ~ "!") in item.content
loop: "{{lb_db.results}}"

View File

@@ -1,2 +1,4 @@
---
# handlers file for apache2
- name: restart apache2
service: name=apache2 state=restarted

View File

@@ -1,2 +1,45 @@
---
# tasks file for apache2
- name: install web components
apt: name={{item}} state=present update_cache=yes
loop:
- apache2
- python3-pip
- python3-virtualenv
- python3-venv
- python3-mysqldb
- libapache2-mod-wsgi-py3
- name: ensure apache2 started
service: name=apache2 state=started enabled=yes
- name: ensure mod_wsgi enabled
apache2_module: state=present name=wsgi
notify: restart apache2
- name: copy demo app source
copy: src=demo/app/ dest=/var/www/demo mode=0755
notify: restart apache2
- name: copy apache virtual host config
copy: src=demo/demo.conf dest=/etc/apache2/sites-available mode=0755
notify: restart apache2
- name: initialize virtualenv
shell: python3 -m venv /var/www/demo/.venv creates=/var/www/demo/.venv
- name: source virtualenv and install app dependencies
shell: . /var/www/demo/.venv/bin/activate && pip install -r /var/www/demo/requirements.txt
notify: restart apache2
- name: setup python virtualenv
pip: requirements=/var/www/demo/requirements.txt virtualenv=/var/www/demo/.venv
notify: restart apache2
- name: de-activate default apache site
file: path=/etc/apache2/sites-enabled/000-default.conf state=absent
notify: restart apache2
- name: activate demo apache site
file: src=/etc/apache2/sites-available/demo.conf dest=/etc/apache2/sites-enabled/demo.conf state=link
notify: restart apache2

View File

@@ -1,6 +1,6 @@
---
- name: install tools
apt: name={{item}} state=present update_cache=yes
with_items:
loop:
- curl
- python-httplib2
- python3-httplib2

View File

@@ -5,13 +5,23 @@
- python3-mysqldb
- name: install mysql-server
apt: name=mysql-server state=present update_cache=yes
apt: name=mysql-server-8.0 state=present update_cache=yes
- name: ensure mysql started
- name: ensure mysql started properly
service: name=mysql state=started enabled=yes
register: mysql_status
until: mysql_status is success
retries: 5
delay: 5
- name: read mysql_status
debug: var=mysql_status
- name: ensure mysql listening on all ports
lineinfile: dest=/etc/mysql/my.cnf regexp=^bind-address line="bind-address = 0.0.0.0"
lineinfile:
dest: /etc/mysql/my.cnf
regexp: '^\[mysqld\]'
line: "[mysqld]\nbind-address = 0.0.0.0"
notify: restart mysql
- name: create demo database

View File

@@ -0,0 +1,8 @@
---
- import_playbook: playbooks/hostname.yml
- import_playbook: database.yml
- import_playbook: webserver.yml
- import_playbook: loadbalancer.yml
- import_playbook: control.yml
- import_playbook: playbooks/stack_restart.yml
- import_playbook: playbooks/stack_status.yml

View File

@@ -1,43 +1,8 @@
---
- hosts: webserver
become: true
tasks:
- name: install web components
apt: name={{item}} state=present update_cache=yes
with_items:
roles:
- apache2
- libapache2-mod-wsgi
- python-pip
- python-virtualenv
- python-mysqldb
- name: ensure apache2 started
service: name=apache2 state=started enabled=yes
- name: ensure mod_wsgi enabled
apache2_module: state=present name=wsgi
notify: restart apache2
- name: copy demo app source
copy: src=demo/app/ dest=/var/www/demo mode=0755
notify: restart apache2
- name: copy apache virtual host config
copy: src=demo/demo.conf dest=/etc/apache2/sites-available mode=0755
notify: restart apache2
- name: setup python virtualenv
pip: requirements=/var/www/demo/requirements.txt virtualenv=/var/www/demo/.venv
notify: restart apache2
- name: de-activate default apache site
file: path=/etc/apache2/sites-enabled/000-default.conf state=absent
notify: restart apache2
- name: activate demo apache site
file: src=/etc/apache2/sites-available/demo.conf dest=/etc/apache2/sites-enabled/demo.conf state=link
notify: restart apache2
handlers:
- name: restart apache2
service: name=apache2 state=restarted

View File

@@ -0,0 +1,11 @@
[control]
192.168.11.10
[database]
192.168.11.20
[loadbalancer]
192.168.11.30
[webserver]
192.168.11.40

View File

@@ -1,6 +1,6 @@
---
- include: control.yml
- include: database.yml
- include: webserver.yml
- include: loadbalancer.yml
- include: playbooks/stack_status.yml
- import_playbook: control.yml
- import_playbook: database.yml
- import_playbook: webserver.yml
- import_playbook: loadbalancer.yml
- import_playbook: playbooks/stack_status.yml

View File

@@ -1,6 +1,6 @@
---
- include: control.yml
- include: database.yml
- include: webserver.yml
- include: loadbalancer.yml
- include: playbooks/stack_status.yml
- ansible.builtin.import_playbook: control.yml
- ansible.builtin.import_playbook: database.yml
- ansible.builtin.import_playbook: webserver.yml
- ansible.builtin.import_playbook: loadbalancer.yml
- ansible.builtin.import_playbook: playbooks/stack_status.yml

View File

@@ -0,0 +1,5 @@
---
- hosts: control
become: true
roles:
- control

View File

@@ -0,0 +1,5 @@
---
- hosts: database
become: true
roles:
- mysql

View File

@@ -0,0 +1,20 @@
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
import os, socket
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = os.environ['DATABASE_URI']
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
db = SQLAlchemy(app)
hostname = socket.gethostname()
@app.route('/')
def index():
return 'Hello, from sunny %s!\n' % hostname
@app.route('/db')
def dbtest():
return 'Database Connected from %s!\n' % hostname
if __name__ == '__main__':
app.run()

View File

@@ -0,0 +1,7 @@
import os
os.environ['DATABASE_URI'] = 'mysql://demo:demo@db01/demo'
import sys
sys.path.insert(0, '/var/www/demo')
from demo import app as application

View File

@@ -0,0 +1,9 @@
click==7.1.2
Flask==1.1.4
Flask-SQLAlchemy==2.5.1
greenlet==3.5.0
itsdangerous==1.1.0
Jinja2==2.11.3
MarkupSafe==2.0.1
SQLAlchemy==1.4.32
Werkzeug==1.0.1

View File

@@ -0,0 +1,12 @@
<VirtualHost *>
WSGIScriptAlias / /var/www/demo/demo.wsgi
WSGIDaemonProcess demo python-home=/var/www/demo/.venv python-path=/var/www/demo
WSGIProcessGroup demo
<Directory /var/www/demo>
WSGIProcessGroup demo
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
Allow from all
</Directory>
</VirtualHost>

11
examples/034_rols/hosts Normal file
View File

@@ -0,0 +1,11 @@
[control]
192.168.11.10
[database]
192.168.11.20
[loadbalancer]
192.168.11.30
[webserver]
192.168.11.40

View File

@@ -0,0 +1,6 @@
---
- hosts: loadbalancer
become: true
roles:
- nginx

View File

@@ -0,0 +1,11 @@
---
- hosts: all
tasks:
- name: Ping to servers
ping:
- name: Get hostname
command: hostname
register: hostname
- name: Show hostname with message
debug:
msg: "The hostname of this server is {{ hostname.stdout }}"

View File

@@ -0,0 +1,33 @@
---
# Bring stack down
- hosts: loadbalancer
become: true
tasks:
- service: name=nginx state=stopped
- wait_for: port=80 state=drained
- hosts: webserver
become: true
tasks:
- service: name=apache2 state=stopped
- wait_for: port=80 state=stopped
# Restart mysql
- hosts: database
become: true
tasks:
- service: name=mysql state=restarted
- wait_for: port=3306 state=started
# Bring stack up
- hosts: webserver
become: true
tasks:
- service: name=apache2 state=started
- wait_for: port=80
- hosts: loadbalancer
become: true
tasks:
- service: name=nginx state=started
- wait_for: port=80

View File

@@ -0,0 +1,70 @@
---
- hosts: loadbalancer
become: true
tasks:
- name: verify nginx service
command: service nginx status
- name: verify nginx is listening on 80
wait_for: port=80 timeout=1
- hosts: webserver
become: true
tasks:
- name: verify apache2 service
command: service apache2 status
- name: verify apache2 is listening on 80
wait_for: port=80 timeout=1
- hosts: database
become: true
tasks:
- name: verify mysql service
command: service mysql status
- name: verify mysql is listening on 3306
wait_for: port=3306 timeout=1
- hosts: loadbalancer
tasks:
- name: verify backend index response
uri: url=http://{{item}} return_content=yes
loop: "{{ groups.webserver }}"
register: app_index
- fail: msg="index failed to return content"
when: ("Hello, from sunny " ~ item.content ~ "!") in item.content
loop: "{{app_index.results}}"
- name: verify backend db response
uri: url=http://{{item}}/db return_content=yes
loop: "{{ groups.webserver }}"
register: app_db
- fail: msg="db failed to return content"
when: ("Database Connected from " ~ item.content ~ "!") in item.content
loop: "{{app_db.results}}"
- hosts: control
tasks:
- name: get elements from loadbalancer group
debug: var=groups.loadbalancer
- name: verify end-to-end connectivity to loadbalancer
uri: url=http://{{item}} return_content=yes
loop: "{{ groups.loadbalancer }}"
register: lb_connectivity
- fail: msg="index failed to return content"
when: ("Hello, from sunny " ~ item.content ~ "!") in item.content
loop: "{{lb_connectivity.results}}"
- name: verify end-to-end db response
uri: url=http://{{item}}/db return_content=yes
loop: "{{ groups.loadbalancer }}"
register: lb_db
- fail: msg="db failed to return content"
when: ("Database Connected from " ~ item.content ~ "!") in item.content
loop: "{{lb_db.results}}"

View File

@@ -0,0 +1,2 @@
---
# defaults file for apache2

View File

@@ -0,0 +1,4 @@
---
# handlers file for apache2
- name: restart apache2
service: name=apache2 state=restarted

View File

@@ -0,0 +1,139 @@
---
galaxy_info:
author: your name
description:
company: your company (optional)
# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
# issue_tracker_url: http://example.com/issue/tracker
# Some suggested licenses:
# - BSD (default)
# - MIT
# - GPLv2
# - GPLv3
# - Apache
# - CC-BY
license: license (GPLv2, CC-BY, etc)
min_ansible_version: 1.2
#
# Below are all platforms currently available. Just uncomment
# the ones that apply to your role. If you don't see your
# platform on this list, let us know and we'll get it added!
#
#platforms:
#- name: EL
# versions:
# - all
# - 5
# - 6
# - 7
#- name: GenericUNIX
# versions:
# - all
# - any
#- name: Fedora
# versions:
# - all
# - 16
# - 17
# - 18
# - 19
# - 20
# - 21
# - 22
#- name: Windows
# versions:
# - all
# - 2012R2
#- name: SmartOS
# versions:
# - all
# - any
#- name: opensuse
# versions:
# - all
# - 12.1
# - 12.2
# - 12.3
# - 13.1
# - 13.2
#- name: Amazon
# versions:
# - all
# - 2013.03
# - 2013.09
#- name: GenericBSD
# versions:
# - all
# - any
#- name: FreeBSD
# versions:
# - all
# - 8.0
# - 8.1
# - 8.2
# - 8.3
# - 8.4
# - 9.0
# - 9.1
# - 9.1
# - 9.2
#- name: Ubuntu
# versions:
# - all
# - lucid
# - maverick
# - natty
# - oneiric
# - precise
# - quantal
# - raring
# - saucy
# - trusty
# - utopic
# - vivid
#- name: SLES
# versions:
# - all
# - 10SP3
# - 10SP4
# - 11
# - 11SP1
# - 11SP2
# - 11SP3
#- name: GenericLinux
# versions:
# - all
# - any
#- name: Debian
# versions:
# - all
# - etch
# - jessie
# - lenny
# - squeeze
# - wheezy
#
# Below are all categories currently available. Just as with
# the platforms above, uncomment those that apply to your role.
#
#categories:
#- cloud
#- cloud:ec2
#- cloud:gce
#- cloud:rax
#- clustering
#- database
#- database:nosql
#- database:sql
#- development
#- monitoring
#- networking
#- packaging
#- system
#- web
dependencies: []
# List your role dependencies here, one per line.
# Be sure to remove the '[]' above if you add dependencies
# to this list.

View File

@@ -0,0 +1,45 @@
---
# tasks file for apache2
- name: install web components
apt: name={{item}} state=present update_cache=yes
loop:
- apache2
- python3-pip
- python3-virtualenv
- python3-venv
- python3-mysqldb
- libapache2-mod-wsgi-py3
- name: ensure apache2 started
service: name=apache2 state=started enabled=yes
- name: ensure mod_wsgi enabled
apache2_module: state=present name=wsgi
notify: restart apache2
- name: copy demo app source
copy: src=demo/app/ dest=/var/www/demo mode=0755
notify: restart apache2
- name: copy apache virtual host config
copy: src=demo/demo.conf dest=/etc/apache2/sites-available mode=0755
notify: restart apache2
- name: initialize virtualenv
shell: python3 -m venv /var/www/demo/.venv creates=/var/www/demo/.venv
- name: source virtualenv and install app dependencies
shell: . /var/www/demo/.venv/bin/activate && pip install -r /var/www/demo/requirements.txt
notify: restart apache2
- name: setup python virtualenv
pip: requirements=/var/www/demo/requirements.txt virtualenv=/var/www/demo/.venv
notify: restart apache2
- name: de-activate default apache site
file: path=/etc/apache2/sites-enabled/000-default.conf state=absent
notify: restart apache2
- name: activate demo apache site
file: src=/etc/apache2/sites-available/demo.conf dest=/etc/apache2/sites-enabled/demo.conf state=link
notify: restart apache2

View File

@@ -0,0 +1,2 @@
---
# vars file for apache2

View File

@@ -0,0 +1,2 @@
---
# defaults file for control

View File

@@ -0,0 +1,2 @@
---
# handlers file for control

View File

@@ -0,0 +1,139 @@
---
galaxy_info:
author: your name
description:
company: your company (optional)
# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
# issue_tracker_url: http://example.com/issue/tracker
# Some suggested licenses:
# - BSD (default)
# - MIT
# - GPLv2
# - GPLv3
# - Apache
# - CC-BY
license: license (GPLv2, CC-BY, etc)
min_ansible_version: 1.2
#
# Below are all platforms currently available. Just uncomment
# the ones that apply to your role. If you don't see your
# platform on this list, let us know and we'll get it added!
#
#platforms:
#- name: EL
# versions:
# - all
# - 5
# - 6
# - 7
#- name: GenericUNIX
# versions:
# - all
# - any
#- name: Fedora
# versions:
# - all
# - 16
# - 17
# - 18
# - 19
# - 20
# - 21
# - 22
#- name: Windows
# versions:
# - all
# - 2012R2
#- name: SmartOS
# versions:
# - all
# - any
#- name: opensuse
# versions:
# - all
# - 12.1
# - 12.2
# - 12.3
# - 13.1
# - 13.2
#- name: Amazon
# versions:
# - all
# - 2013.03
# - 2013.09
#- name: GenericBSD
# versions:
# - all
# - any
#- name: FreeBSD
# versions:
# - all
# - 8.0
# - 8.1
# - 8.2
# - 8.3
# - 8.4
# - 9.0
# - 9.1
# - 9.1
# - 9.2
#- name: Ubuntu
# versions:
# - all
# - lucid
# - maverick
# - natty
# - oneiric
# - precise
# - quantal
# - raring
# - saucy
# - trusty
# - utopic
# - vivid
#- name: SLES
# versions:
# - all
# - 10SP3
# - 10SP4
# - 11
# - 11SP1
# - 11SP2
# - 11SP3
#- name: GenericLinux
# versions:
# - all
# - any
#- name: Debian
# versions:
# - all
# - etch
# - jessie
# - lenny
# - squeeze
# - wheezy
#
# Below are all categories currently available. Just as with
# the platforms above, uncomment those that apply to your role.
#
#categories:
#- cloud
#- cloud:ec2
#- cloud:gce
#- cloud:rax
#- clustering
#- database
#- database:nosql
#- database:sql
#- development
#- monitoring
#- networking
#- packaging
#- system
#- web
dependencies: []
# List your role dependencies here, one per line.
# Be sure to remove the '[]' above if you add dependencies
# to this list.

View File

@@ -0,0 +1,6 @@
---
- name: install tools
apt: name={{item}} state=present update_cache=yes
loop:
- curl
- python3-httplib2

View File

@@ -0,0 +1,2 @@
---
# vars file for control

View File

@@ -0,0 +1,38 @@
Role Name
=========
A brief description of the role goes here.
Requirements
------------
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
Role Variables
--------------
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
Dependencies
------------
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
Example Playbook
----------------
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
- hosts: servers
roles:
- { role: username.rolename, x: 42 }
License
-------
BSD
Author Information
------------------
An optional section for the role authors to include contact information, or a website (HTML is not allowed).

View File

@@ -0,0 +1,2 @@
---
# defaults file for demo_app

View File

@@ -0,0 +1,2 @@
---
# handlers file for demo_app

View File

@@ -0,0 +1,139 @@
---
galaxy_info:
author: your name
description:
company: your company (optional)
# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
# issue_tracker_url: http://example.com/issue/tracker
# Some suggested licenses:
# - BSD (default)
# - MIT
# - GPLv2
# - GPLv3
# - Apache
# - CC-BY
license: license (GPLv2, CC-BY, etc)
min_ansible_version: 1.2
#
# Below are all platforms currently available. Just uncomment
# the ones that apply to your role. If you don't see your
# platform on this list, let us know and we'll get it added!
#
#platforms:
#- name: EL
# versions:
# - all
# - 5
# - 6
# - 7
#- name: GenericUNIX
# versions:
# - all
# - any
#- name: Fedora
# versions:
# - all
# - 16
# - 17
# - 18
# - 19
# - 20
# - 21
# - 22
#- name: Windows
# versions:
# - all
# - 2012R2
#- name: SmartOS
# versions:
# - all
# - any
#- name: opensuse
# versions:
# - all
# - 12.1
# - 12.2
# - 12.3
# - 13.1
# - 13.2
#- name: Amazon
# versions:
# - all
# - 2013.03
# - 2013.09
#- name: GenericBSD
# versions:
# - all
# - any
#- name: FreeBSD
# versions:
# - all
# - 8.0
# - 8.1
# - 8.2
# - 8.3
# - 8.4
# - 9.0
# - 9.1
# - 9.1
# - 9.2
#- name: Ubuntu
# versions:
# - all
# - lucid
# - maverick
# - natty
# - oneiric
# - precise
# - quantal
# - raring
# - saucy
# - trusty
# - utopic
# - vivid
#- name: SLES
# versions:
# - all
# - 10SP3
# - 10SP4
# - 11
# - 11SP1
# - 11SP2
# - 11SP3
#- name: GenericLinux
# versions:
# - all
# - any
#- name: Debian
# versions:
# - all
# - etch
# - jessie
# - lenny
# - squeeze
# - wheezy
#
# Below are all categories currently available. Just as with
# the platforms above, uncomment those that apply to your role.
#
#categories:
#- cloud
#- cloud:ec2
#- cloud:gce
#- cloud:rax
#- clustering
#- database
#- database:nosql
#- database:sql
#- development
#- monitoring
#- networking
#- packaging
#- system
#- web
dependencies: []
# List your role dependencies here, one per line.
# Be sure to remove the '[]' above if you add dependencies
# to this list.

View File

@@ -0,0 +1,2 @@
---
# tasks file for demo_app

View File

@@ -0,0 +1,2 @@
---
# vars file for demo_app

Some files were not shown because too many files have changed in this diff Show More