diff --git a/misc/arquitectura-ansible.pdf b/arquitectura-ansible.pdf similarity index 100% rename from misc/arquitectura-ansible.pdf rename to arquitectura-ansible.pdf diff --git a/examples/000_example/group_vars/all b/examples/000_example/group_vars/all deleted file mode 100755 index 6f2aaac..0000000 --- a/examples/000_example/group_vars/all +++ /dev/null @@ -1,3 +0,0 @@ ---- -httpd_port: 80 -ntpserver: 192.168.0.2 diff --git a/examples/000_example/group_vars/webservers b/examples/000_example/group_vars/webservers deleted file mode 100755 index 2514c06..0000000 --- a/examples/000_example/group_vars/webservers +++ /dev/null @@ -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 diff --git a/examples/000_example/hosts b/examples/000_example/hosts deleted file mode 100755 index 5e5fc9c..0000000 --- a/examples/000_example/hosts +++ /dev/null @@ -1,2 +0,0 @@ -[webservers] -192.168.0.2 \ No newline at end of file diff --git a/examples/000_example/roles/apache/README.md b/examples/000_example/roles/apache/README.md deleted file mode 100755 index 225dd44..0000000 --- a/examples/000_example/roles/apache/README.md +++ /dev/null @@ -1,38 +0,0 @@ -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). diff --git a/examples/000_example/roles/apache/defaults/main.yml b/examples/000_example/roles/apache/defaults/main.yml deleted file mode 100755 index 596f53c..0000000 --- a/examples/000_example/roles/apache/defaults/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# defaults file for apache \ No newline at end of file diff --git a/examples/000_example/roles/apache/handlers/main.yml b/examples/000_example/roles/apache/handlers/main.yml deleted file mode 100755 index d65a488..0000000 --- a/examples/000_example/roles/apache/handlers/main.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -# handlers file for apache -- name: restart apache - service: name=apache2 state=restarted diff --git a/examples/000_example/roles/apache/meta/main.yml b/examples/000_example/roles/apache/meta/main.yml deleted file mode 100755 index 7223799..0000000 --- a/examples/000_example/roles/apache/meta/main.yml +++ /dev/null @@ -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. \ No newline at end of file diff --git a/examples/000_example/roles/apache/tasks/main.yml b/examples/000_example/roles/apache/tasks/main.yml deleted file mode 100755 index ec2922b..0000000 --- a/examples/000_example/roles/apache/tasks/main.yml +++ /dev/null @@ -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 diff --git a/examples/000_example/roles/apache/templates/httpd.conf.j2 b/examples/000_example/roles/apache/templates/httpd.conf.j2 deleted file mode 100755 index dd2e0fb..0000000 --- a/examples/000_example/roles/apache/templates/httpd.conf.j2 +++ /dev/null @@ -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 ); -# 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 -# container, error messages relating to that virtual host will be -# logged here. If you *do* define an error logfile for a -# 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. - - Options FollowSymLinks - AllowOverride None - Require all denied - - - - AllowOverride None - Require all granted - - - - Options FollowSymLinks - AllowOverride None - Require all granted - - -# -# Options Indexes FollowSymLinks -# AllowOverride None -# Require all granted -# - - - - -# 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. -# - - Require all denied - - - -# -# 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 \ No newline at end of file diff --git a/examples/000_example/roles/apache/templates/index.html.j2 b/examples/000_example/roles/apache/templates/index.html.j2 deleted file mode 100755 index c8da5d9..0000000 --- a/examples/000_example/roles/apache/templates/index.html.j2 +++ /dev/null @@ -1,6 +0,0 @@ -{{ apache_test_message }} {{ ansible_distribution }} {{ ansible_distribution_version }}
-Current Host: {{ ansible_hostname }}
-Server list:
-{% for host in groups.webservers %} -{{ host }}
-{% endfor %} diff --git a/examples/000_example/roles/apache/tests/inventory b/examples/000_example/roles/apache/tests/inventory deleted file mode 100755 index 878877b..0000000 --- a/examples/000_example/roles/apache/tests/inventory +++ /dev/null @@ -1,2 +0,0 @@ -localhost - diff --git a/examples/000_example/roles/apache/tests/test.yml b/examples/000_example/roles/apache/tests/test.yml deleted file mode 100755 index 6df1468..0000000 --- a/examples/000_example/roles/apache/tests/test.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- hosts: webservers - remote_user: root - roles: - - apache \ No newline at end of file diff --git a/examples/000_example/roles/apache/vars/main.yml b/examples/000_example/roles/apache/vars/main.yml deleted file mode 100755 index 1173dc9..0000000 --- a/examples/000_example/roles/apache/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for apache \ No newline at end of file diff --git a/examples/000_example/roles/common/README.md b/examples/000_example/roles/common/README.md deleted file mode 100755 index 225dd44..0000000 --- a/examples/000_example/roles/common/README.md +++ /dev/null @@ -1,38 +0,0 @@ -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). diff --git a/examples/000_example/roles/common/defaults/main.yml b/examples/000_example/roles/common/defaults/main.yml deleted file mode 100755 index fa30550..0000000 --- a/examples/000_example/roles/common/defaults/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# defaults file for common \ No newline at end of file diff --git a/examples/000_example/roles/common/handlers/main.yml b/examples/000_example/roles/common/handlers/main.yml deleted file mode 100755 index 4d78ef2..0000000 --- a/examples/000_example/roles/common/handlers/main.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -# handlers file for common -- name: restart ntp - service: name=ntpd state=restarted diff --git a/examples/000_example/roles/common/meta/main.yml b/examples/000_example/roles/common/meta/main.yml deleted file mode 100755 index 7223799..0000000 --- a/examples/000_example/roles/common/meta/main.yml +++ /dev/null @@ -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. \ No newline at end of file diff --git a/examples/000_example/roles/common/tasks/main.yml b/examples/000_example/roles/common/tasks/main.yml deleted file mode 100755 index 293c480..0000000 --- a/examples/000_example/roles/common/tasks/main.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -# tasks file for common -- name: install epel repo - apt: - name: epel-release - state: present - -- include: selinux.yml -- include: ntp.yml diff --git a/examples/000_example/roles/common/tasks/ntp.yml b/examples/000_example/roles/common/tasks/ntp.yml deleted file mode 100755 index f9e704e..0000000 --- a/examples/000_example/roles/common/tasks/ntp.yml +++ /dev/null @@ -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 diff --git a/examples/000_example/roles/common/tasks/selinux.yml b/examples/000_example/roles/common/tasks/selinux.yml deleted file mode 100755 index 7ef6a3c..0000000 --- a/examples/000_example/roles/common/tasks/selinux.yml +++ /dev/null @@ -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 diff --git a/examples/000_example/roles/common/templates/ntp.conf.j2 b/examples/000_example/roles/common/templates/ntp.conf.j2 deleted file mode 100755 index e5c5483..0000000 --- a/examples/000_example/roles/common/templates/ntp.conf.j2 +++ /dev/null @@ -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 diff --git a/examples/000_example/roles/common/tests/inventory b/examples/000_example/roles/common/tests/inventory deleted file mode 100755 index 878877b..0000000 --- a/examples/000_example/roles/common/tests/inventory +++ /dev/null @@ -1,2 +0,0 @@ -localhost - diff --git a/examples/000_example/roles/common/tests/test.yml b/examples/000_example/roles/common/tests/test.yml deleted file mode 100755 index 8d24282..0000000 --- a/examples/000_example/roles/common/tests/test.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- hosts: localhost - remote_user: root - roles: - - common \ No newline at end of file diff --git a/examples/000_example/roles/common/vars/main.yml b/examples/000_example/roles/common/vars/main.yml deleted file mode 100755 index feaa92f..0000000 --- a/examples/000_example/roles/common/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for common \ No newline at end of file diff --git a/examples/000_example/site.yml b/examples/000_example/site.yml deleted file mode 100755 index d867915..0000000 --- a/examples/000_example/site.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: install and start apache - hosts: webservers - remote_user: root - become: yes - roles: - - apache \ No newline at end of file diff --git a/examples/000_initial_example/001-hostname.yml b/examples/000_initial_example/000_initial_example.yml similarity index 100% rename from examples/000_initial_example/001-hostname.yml rename to examples/000_initial_example/000_initial_example.yml diff --git a/examples/000_initial_example/hosts b/examples/000_initial_example/hosts index 6c37d55..0432cdd 100644 --- a/examples/000_initial_example/hosts +++ b/examples/000_initial_example/hosts @@ -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 \ No newline at end of file