├── lab_bonus.md ├── lab04.md ├── LICENSE ├── lab03.md ├── lab02.md ├── lab01.md └── README.md /lab_bonus.md: -------------------------------------------------------------------------------- 1 | Write play for each of the following modules: 2 | - ping 3 | - setup 4 | - yum 5 | - service 6 | - user 7 | - copy 8 | - file 9 | - git 10 | - lineinfile 11 | - htpasswd 12 | - script 13 | - debug 14 | -------------------------------------------------------------------------------- /lab04.md: -------------------------------------------------------------------------------- 1 | 1. Create playbook to: 2 | - Install NFS 3 | - Export /home/users 4 | - Deployed to hosts in group `bastion` 5 | 2. Create playbook to: 6 | - Install mysql client and maria server and start it up. 7 | - Deployed to hosts in group `database` 8 | 9 | 3. Install lighttpd 10 | - Using the role located at https://github.com/monzell/ansible-lighttpd/archive/v0.1.tar.gz 11 | - Install on `web` group 12 | 13 | 4. Install CA certs from https://www.geotrust.com/resources/root-certificates/ into /etc/pki/ca-trust/source/anchors/ and run update-ca-trust. 14 | - install on `web` group 15 | 16 | 5. Consolidate 1-4 into a single play 17 | - each role should be tagged 18 | - It should with all hosts in inventory 19 | 20 | 6. Write a play for each of the following modules: 21 | - ping 22 | - setup 23 | - yum 24 | - service 25 | - user 26 | - copy 27 | - file 28 | - git 29 | - lineinfile 30 | - htpasswd 31 | - script 32 | - debug 33 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Rilindo Foster 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /lab03.md: -------------------------------------------------------------------------------- 1 | 1. Run an ansible add-hoc command to install httpd on web group 2 | 2. Create a playbook to: 3 | - an encrypted file "secure" with variable "shipclass" set to "truman" 4 | - Create a file in /var/www/html/shipclass.html using variables in the encrypted file. 5 | - install on `web` group 6 | 3. Create a playbook: 7 | - Install MariaDB server with the password of `m4rzN4vy` for root 8 | - drop anonymous tables. 9 | - install on `database` group 10 | - Add error handling for dropping anonymous tables 11 | 4. Create a playbook to: 12 | - Add `tony`, `steve`, and `nat` as users 13 | - Make ure that `tony` can sudo as root. 14 | - Make sure that `nat` can sudo, but be prompted for the password 15 | - password are as follows: `st4Rk`, `r0geR5`, `RoMan0v@` 16 | - install on bastion host 17 | 5. Install torquebox role using the following URL: https://github.com/juggy/torquebox-ansible/archive/master.zip 18 | - put it on `app` group 19 | 20 | 6. Consolidate 2-4 into a single play 21 | - Give it the ability to run each playbook using tags 22 | - Run it against all hosts 23 | 24 | 7. Create a playbook too 25 | - get the output of `ps aux` 26 | - save the output into `/tmp/process_snapshot.txt` 27 | - run it against all hosts 28 | -------------------------------------------------------------------------------- /lab02.md: -------------------------------------------------------------------------------- 1 | Note: wrap ad-hoc commands in bash 2 | 3 | 1. Run an ansible add-hoc command to install elinks 4 | 2. Create a file "/tmp/hosts.txt" with the OS, IP and Hostname. 5 | - put it on all hosts 6 | 3. Create a playbook to: 7 | - Add `donnager.example.com` to /etc/hosts set to the ip of the host 8 | - Install httpd and ensure: 9 | - It is running 10 | - It will start on boot 11 | - Set host to `donnager.example.com` 12 | - Executed when you run tag `webserver` 13 | - Create a site: 14 | - Added an index.html in /var/www/donnager.example.com/public_html/ with the follow text 15 | - Welcome to the Martian Marine Web Site 16 | - Password protect page with the following username and password 17 | - bobbie - cucUmb3rS4nwitch 18 | - Applied to hosts in group `web` 19 | 20 | Here is a virtualhost to use for the site 21 | 22 | ``` 23 | 24 | ServerAdmin admin@example.com 25 | ServerName example.com 26 | ServerAlias www.example.com 27 | DocumentRoot /var/www/donnager.example.com/public_html 28 | ErrorLog /var/log/httpd/donnager.example.com.error.log 29 | CustomLog /var/log/httpd/donnager.example.com.access.log combined 30 | 31 | ``` 32 | 33 | And the default site: 34 | ``` 35 | 36 | DocumentRoot "/www/default" 37 | 38 | ``` 39 | 4. Set default ansible forks to 20. 40 | 5. Set default ansible timeout to 120 seconds. 41 | 6. Write a playbook to: 42 | - apply all security updates 43 | - reboot all instances and monitor until they come back up 44 | 45 | 7. Write a playbook to: 46 | - get the output of `rpm -qa` 47 | - save the output to `/tmp/package-report.txt` 48 | - put it on all hosts 49 | -------------------------------------------------------------------------------- /lab01.md: -------------------------------------------------------------------------------- 1 | 1. Create a playbook that performs the following on `bastion`: 2 | - create directory /home/users 3 | - create a 5 gig logical volume group called `vg01` 4 | - creates a 1 gig logical volume call `users01`, 5 | - create a xfs file system on logical volume `users01` 6 | - mount volumes under /home/users and should be persistent 7 | 8 | Note that if you are working with system that does not have a block device to work with, you can create one with a disk image and a loopback: 9 | 10 | ``` 11 | fallocate -l 1G /opt/disk01.img 12 | losetup /dev/loop1 /opt/disk01.img 13 | ``` 14 | 15 | 2. Create a playbook on `bastion` to create: 16 | - Create in /home/sol 17 | - Usernames and passwords will be will be: 18 | - `alex` - `L4sagna` 19 | - `naomi` - `k1bBle` 20 | - `james` - `c0ff33` 21 | - `amos` - `h3nnEsy` 22 | - Only `naomi` and `james` should have shell access using bash 23 | - All the users will be in the group `crew` 24 | - The users will be created with tag `users` 25 | - Applied to hosts in group `bastion` 26 | - Password to protect the users will be `prot0mo|eculE` 27 | 28 | 3. Create playbook on all hosts to: 29 | - Install postfix 30 | - Enable postfix on startup 31 | - Launch postfix 32 | 33 | 4. Create role on to: 34 | - Install squid 35 | - Configure squid to block facebook. 36 | - Restart squid 37 | 38 | 5. Create role on to: 39 | - Install vsftpd 40 | - disable anonymous ftp 41 | - restart vsftpd 42 | 43 | 6. Create role on group to: 44 | - Install samba 45 | - Enable for startup 46 | - Configure workgroup as `truman` 47 | - restart samba 48 | 49 | 7. Install via the following via ad-hoc 50 | - elinks on `web` and `app` server groups 51 | - ftp and smbclient on database groups 52 | Be sure to wrapp ad-hoc command within the shell script 53 | 54 | 8. Consolidate 2, 4, 5, and 6 into one playbook with the following: 55 | - web should be tagged `bastion` 56 | - squid role be tagged `filter` 57 | - vsftp role should be tagged `ftp_server` 58 | - smb role should be tagged `file_sharing` 59 | 60 | The play should run against all hosts, but each role should only run as follows: 61 | 62 | - web - bastion group 63 | - squid - app group 64 | - vsftp - database group 65 | - smb - web group 66 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Red Hat EX407 Ansible Specialist Exam Labs 2 | A repo that contains labs for use in practicing for the Red Hat ex407 exam. Feel free to contribute. No content from the exam will be accepted, though. 3 | 4 | # Instructions 5 | 6 | You should complete everything in each lab in just about under an hour (ideally, around 30 minutes). Since the exam is 4 hours, these sessions should give you enough practice to finish all the tasks in the exam while still have time to review and refine. 7 | 8 | ## Lab Environment 9 | 10 | You should have at least 2 servers to work with - your control station (where you run your ansible commands from) and remote server. I recommend you should at least have 4 instances to work with and then you can setup your inventory as follows (ips are not real, of course): 11 | 12 | ``` 13 | [database] 14 | 10.20.30.40 15 | 16 | [web] 17 | 10.40.80.120 18 | 19 | [bastion] 20 | 10.60.120.180 21 | 22 | [app] 23 | 10.100.200.10 24 | ``` 25 | 26 | You should have another one for running Ansible Tower as well. 27 | 28 | The OS should be running Red Hat 7.3 or whatever is stated in the exam (an equivilent version for CentOS should be acceptable) 29 | 30 | NOTE: If you want to practice using a cloud provider, there are many that you can use that are inexpensive, such as Digital Ocean. Feel free to use [this link](https://m.do.co/c/75f7a0300020) to sign up for an account (as well as support this effort by giving me free credits. :) ) 31 | 32 | Finally, while it is not stated what editor you be using, I suggest using vim when writing your playbooks. You can use other editors, but if they are not available during the exam, you may have a bad time 33 | 34 | # Exam Objectives 35 | 36 | The objectives for the EX 407 exam can be found here: 37 | 38 | [Red Hat Certified Specialist in Ansible Automation exam](https://www.redhat.com/en/services/training/ex407-red-hat-certified-specialist-in-ansible-automation-exam) 39 | 40 | # Training 41 | 42 | Official training is provided by Red Hat: 43 | 44 | * [Automation with Ansible I](https://www.redhat.com/en/services/training/do407-automation-ansible-i) 45 | 46 | Inexpensive training can also be found at Linux Academy: 47 | * [Red Hat Certified Specialist in Ansible Automation (EX407) Preparation Course](https://linuxacademy.com/linux/training/course/name/linux-academy-red-hat-certified-specialist-in-ansible-automation) 48 | 49 | # Possible Issues When Taking The Exam 50 | 51 | The exam objectives clearly stated that you will be using ansible 2.3. Be prepared to not be able to use commands that are available in the current ansible release. Here are some gotchas and solutions: 52 | 53 | ## include_tasks 54 | 55 | `include_tasks` does not exists in 2.3. Use `include` statement instead 56 | 57 | ## Tags 58 | 59 | If you need to apply a tag to an entire role, you may need to do this instead: 60 | 61 | ``` 62 | roles: 63 | - { role: webserver, port: 5000, tags: [ 'web', 'foo' ] } 64 | ``` 65 | 66 | [See here for more tag info in 2.3](https://docs.ansible.com/ansible/2.3/playbooks_tags.html) 67 | ## vault-id 68 | 69 | vault-id is not available as a parameter to use. For now, rely on --ask-vault-pass instead. 70 | 71 | ## Certificate Errors 72 | 73 | Given that 2.3 has fairly outdated certificates, you may get an error similar to the following when installing through ansible galaxy: 74 | 75 | ``` 76 | rocinante:ex407_ansible_specialist_practice_tasks rilindo$ ansible-galaxy install https://github.com/monzell/ansible-lighttpd/archive/v0.1.tar.gz validate_certs=False 77 | - downloading role from https://github.com/monzell/ansible-lighttpd/archive/v0.1.tar.gz 78 | [ERROR]: failed to download the file: Failed to validate the SSL certificate for github.com:443. Make sure your managed 79 | systems have a valid CA certificate installed. You can use validate_certs=False if you do not need to confirm the servers 80 | identity but this is unsafe and not recommended. Paths checked for this platform: /etc/ssl/certs, /etc/ansible, 81 | /usr/local/etc/openssl. The exception msg was: ("bad handshake: Error([('SSL routines', 'SSL3_READ_BYTES', 'tlsv1 alert 82 | protocol version')],)",). 83 | ``` 84 | 85 | Use the -c parameter to ignore the errors (in real life, you should really upgrade Ansible) 86 | 87 | ``` 88 | rocinante:ex407_ansible_specialist_practice_tasks rilindo$ ansible-galaxy install https://github.com/monzell/ansible-lighttpd/archive/v0.1.tar.gz -c 89 | - downloading role from https://github.com/monzell/ansible-lighttpd/archive/v0.1.tar.gz 90 | - extracting v0.1 to /etc/ansible/roles/v0.1 91 | ``` 92 | # Tips 93 | 94 | ## Documentation 95 | ### CLI 96 | Most of the documentation can be looked up with `ansible-doc -l`. Since it takes a very long time to pull up, you can pipe the list of modules to file before writing any code. This will save time, as you only need to page through or grep in a text file instead of waiting until `ansible-doc -l` loads. For example, if you need to look up a mysql_user module, you can do this: 97 | 98 | ``` 99 | stardust:~ rilindo$ ansible-doc -l > /tmp/ansible.txt 100 | stardust:~ rilindo$ grep mysql_user /tmp/ansible.txt 101 | mysql_user Adds or removes a user from a MySQL database. 102 | proxysql_mysql_users Adds or removes mysql users from proxysql admin interface. 103 | stardust:~ rilindo$ ansible-doc mysql_user 104 | ``` 105 | ### Loops and Other documentation 106 | 107 | It may be possible to install additional documentation by running: 108 | 109 | ``` 110 | sudo yum -y install ansible-doc 111 | ``` 112 | 113 | 114 | This will let you install ansible web site documentation: 115 | ``` 116 | [centos@centos-s-1vcpu-1gb-sfo2-02 ~]$ sudo yum -y install ansible-doc 117 | Loaded plugins: fastestmirror 118 | Loading mirror speeds from cached hostfile 119 | * base: mirrors.oit.uci.edu 120 | * extras: mirror.sjc02.svwh.net 121 | * updates: mirror.san.fastserv.com 122 | Resolving Dependencies 123 | --> Running transaction check 124 | ---> Package ansible-doc.noarch 0:2.4.2.0-2.el7 will be installed 125 | --> Finished Dependency Resolution 126 | 127 | Dependencies Resolved 128 | 129 | ============================================================================================================================================================================== 130 | Package Arch Version Repository Size 131 | ============================================================================================================================================================================== 132 | Installing: 133 | ansible-doc noarch 2.4.2.0-2.el7 extras 763 k 134 | 135 | Transaction Summary 136 | ============================================================================================================================================================================== 137 | Install 1 Package 138 | 139 | Total download size: 763 k 140 | Installed size: 1.9 M 141 | Downloading packages: 142 | ansible-doc-2.4.2.0-2.el7.noarch.rpm | 763 kB 00:00:00 143 | Running transaction check 144 | Running transaction test 145 | Transaction test succeeded 146 | Running transaction 147 | Installing : ansible-doc-2.4.2.0-2.el7.noarch 1/1 148 | Verifying : ansible-doc-2.4.2.0-2.el7.noarch 1/1 149 | 150 | Installed: 151 | ansible-doc.noarch 0:2.4.2.0-2.el7 152 | 153 | Complete! 154 | [centos@centos-s-1vcpu-1gb-sfo2-02 ~]$ rpm -ql ansible-doc 155 | /usr/share/doc/ansible-doc-2.4.2.0 156 | /usr/share/doc/ansible-doc-2.4.2.0/rst 157 | /usr/share/doc/ansible-doc-2.4.2.0/rst/YAMLSyntax.rst 158 | /usr/share/doc/ansible-doc-2.4.2.0/rst/become.rst 159 | /usr/share/doc/ansible-doc-2.4.2.0/rst/command_line_tools.rst 160 | /usr/share/doc/ansible-doc-2.4.2.0/rst/committer_guidelines.rst 161 | /usr/share/doc/ansible-doc-2.4.2.0/rst/common_return_values.rst 162 | /usr/share/doc/ansible-doc-2.4.2.0/rst/community 163 | /usr/share/doc/ansible-doc-2.4.2.0/rst/community.rst 164 | /usr/share/doc/ansible-doc-2.4.2.0/rst/community/code_of_conduct.rst 165 | /usr/share/doc/ansible-doc-2.4.2.0/rst/community/communication.rst 166 | /usr/share/doc/ansible-doc-2.4.2.0/rst/community/development_process.rst 167 | /usr/share/doc/ansible-doc-2.4.2.0/rst/community/how_can_I_help.rst 168 | /usr/share/doc/ansible-doc-2.4.2.0/rst/community/index.rst 169 | /usr/share/doc/ansible-doc-2.4.2.0/rst/community/maintainers.rst 170 | /usr/share/doc/ansible-doc-2.4.2.0/rst/community/other_tools_and_programs.rst 171 | /usr/share/doc/ansible-doc-2.4.2.0/rst/community/reporting_bugs_and_features.rst 172 | /usr/share/doc/ansible-doc-2.4.2.0/rst/community/triage_process.rst 173 | /usr/share/doc/ansible-doc-2.4.2.0/rst/conf.py 174 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide 175 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/Makefile 176 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/developing_api.rst 177 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/developing_core.rst 178 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/developing_inventory.rst 179 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/developing_module_utilities.rst 180 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/developing_modules.rst 181 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/developing_modules_best_practices.rst 182 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/developing_modules_checklist.rst 183 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/developing_modules_documenting.rst 184 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/developing_modules_general.rst 185 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/developing_modules_general_OLD.rst 186 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/developing_modules_general_windows.rst 187 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/developing_modules_in_groups.rst 188 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/developing_plugins.rst 189 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/developing_program_flow_modules.rst 190 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/developing_python3.rst 191 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/developing_rebasing.rst 192 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/index.rst 193 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/overview_architecture.rst 194 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/repomerge.rst 195 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/style_guide 196 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/style_guide/Makefile 197 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/style_guide/_themes 198 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/style_guide/_themes/srtd 199 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/style_guide/_themes/srtd/__init__.py 200 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/style_guide/_themes/srtd/breadcrumbs.html 201 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/style_guide/_themes/srtd/footer.html 202 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/style_guide/_themes/srtd/layout.html 203 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/style_guide/_themes/srtd/layout_old.html 204 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/style_guide/_themes/srtd/search.html 205 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/style_guide/_themes/srtd/searchbox.html 206 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/style_guide/_themes/srtd/static 207 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/style_guide/_themes/srtd/static/css 208 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/style_guide/_themes/srtd/static/css/badge_only.css 209 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/style_guide/_themes/srtd/static/css/old-theme.css 210 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/style_guide/_themes/srtd/static/css/theme.css 211 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/style_guide/_themes/srtd/static/font 212 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/style_guide/_themes/srtd/static/font/fontawesome_webfont.eot 213 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/style_guide/_themes/srtd/static/font/fontawesome_webfont.svg 214 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/style_guide/_themes/srtd/static/font/fontawesome_webfont.ttf 215 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/style_guide/_themes/srtd/static/font/fontawesome_webfont.woff 216 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/style_guide/_themes/srtd/static/js 217 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/style_guide/_themes/srtd/static/js/theme.js 218 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/style_guide/_themes/srtd/theme.conf 219 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/style_guide/_themes/srtd/versions.html 220 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/style_guide/basic_rules.rst 221 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/style_guide/conf.py 222 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/style_guide/grammar_punctuation.rst 223 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/style_guide/images 224 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/style_guide/images/commas-matter-2.jpg 225 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/style_guide/images/commas-matter.jpg 226 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/style_guide/images/hyphen-funny.jpg 227 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/style_guide/images/thenvsthan.jpg 228 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/style_guide/index.rst 229 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/style_guide/resources.rst 230 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/style_guide/spelling_word_choice.rst 231 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/style_guide/trademarks.rst 232 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/style_guide/voice_style.rst 233 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/style_guide/why_use.rst 234 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/testing 235 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/testing.rst 236 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/testing/compile 237 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/testing/compile/index.rst 238 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/testing/sanity 239 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/testing/sanity/ansible-doc.rst 240 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/testing/sanity/ansible-var-precedence-check.rst 241 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/testing/sanity/azure-requirements.rst 242 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/testing/sanity/boilerplate.rst 243 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/testing/sanity/configure-remoting-ps1.rst 244 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/testing/sanity/empty-init.rst 245 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/testing/sanity/import.rst 246 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/testing/sanity/integration-aliases.rst 247 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/testing/sanity/line-endings.rst 248 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/testing/sanity/no-basestring.rst 249 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/testing/sanity/no-dict-iteritems.rst 250 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/testing/sanity/no-dict-iterkeys.rst 251 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/testing/sanity/no-dict-itervalues.rst 252 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/testing/sanity/no-get-exception.rst 253 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/testing/sanity/no-smart-quotes.rst 254 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/testing/sanity/no-underscore-variable.rst 255 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/testing/sanity/no-unicode-literals.rst 256 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/testing/sanity/no-wildcard-import.rst 257 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/testing/sanity/pep8.rst 258 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/testing/sanity/pylint-ansible-test.rst 259 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/testing/sanity/pylint.rst 260 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/testing/sanity/replace-urlopen.rst 261 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/testing/sanity/required-and-default-attributes.rst 262 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/testing/sanity/rstcheck.rst 263 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/testing/sanity/sanity-docs.rst 264 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/testing/sanity/shebang.rst 265 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/testing/sanity/shellcheck.rst 266 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/testing/sanity/test-constraints.rst 267 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/testing/sanity/use-compat-six.rst 268 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/testing/sanity/validate-modules.rst 269 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/testing/sanity/yamllint.rst 270 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/testing_compile.rst 271 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/testing_httptester.rst 272 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/testing_integration.rst 273 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/testing_integration_legacy.rst 274 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/testing_pep8.rst 275 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/testing_running_locally.rst 276 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/testing_sanity.rst 277 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/testing_units.rst 278 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/testing_units_modules.rst 279 | /usr/share/doc/ansible-doc-2.4.2.0/rst/dev_guide/testing_validate-modules.rst 280 | /usr/share/doc/ansible-doc-2.4.2.0/rst/faq.rst 281 | /usr/share/doc/ansible-doc-2.4.2.0/rst/galaxy.rst 282 | /usr/share/doc/ansible-doc-2.4.2.0/rst/glossary.rst 283 | /usr/share/doc/ansible-doc-2.4.2.0/rst/guide_aws.rst 284 | /usr/share/doc/ansible-doc-2.4.2.0/rst/guide_azure.rst 285 | /usr/share/doc/ansible-doc-2.4.2.0/rst/guide_cloudstack.rst 286 | /usr/share/doc/ansible-doc-2.4.2.0/rst/guide_docker.rst 287 | /usr/share/doc/ansible-doc-2.4.2.0/rst/guide_gce.rst 288 | /usr/share/doc/ansible-doc-2.4.2.0/rst/guide_kubernetes.rst 289 | /usr/share/doc/ansible-doc-2.4.2.0/rst/guide_packet.rst 290 | /usr/share/doc/ansible-doc-2.4.2.0/rst/guide_rax.rst 291 | /usr/share/doc/ansible-doc-2.4.2.0/rst/guide_rolling_upgrade.rst 292 | /usr/share/doc/ansible-doc-2.4.2.0/rst/guide_vagrant.rst 293 | /usr/share/doc/ansible-doc-2.4.2.0/rst/guides.rst 294 | /usr/share/doc/ansible-doc-2.4.2.0/rst/index.rst 295 | /usr/share/doc/ansible-doc-2.4.2.0/rst/intro.rst 296 | /usr/share/doc/ansible-doc-2.4.2.0/rst/intro_adhoc.rst 297 | /usr/share/doc/ansible-doc-2.4.2.0/rst/intro_bsd.rst 298 | /usr/share/doc/ansible-doc-2.4.2.0/rst/intro_configuration.rst 299 | /usr/share/doc/ansible-doc-2.4.2.0/rst/intro_dynamic_inventory.rst 300 | /usr/share/doc/ansible-doc-2.4.2.0/rst/intro_getting_started.rst 301 | /usr/share/doc/ansible-doc-2.4.2.0/rst/intro_installation.rst 302 | /usr/share/doc/ansible-doc-2.4.2.0/rst/intro_inventory.rst 303 | /usr/share/doc/ansible-doc-2.4.2.0/rst/intro_networking.rst 304 | /usr/share/doc/ansible-doc-2.4.2.0/rst/intro_patterns.rst 305 | /usr/share/doc/ansible-doc-2.4.2.0/rst/intro_windows.rst 306 | /usr/share/doc/ansible-doc-2.4.2.0/rst/modules 307 | /usr/share/doc/ansible-doc-2.4.2.0/rst/modules.rst 308 | /usr/share/doc/ansible-doc-2.4.2.0/rst/modules/.gitdir 309 | /usr/share/doc/ansible-doc-2.4.2.0/rst/modules_intro.rst 310 | /usr/share/doc/ansible-doc-2.4.2.0/rst/modules_support.rst 311 | /usr/share/doc/ansible-doc-2.4.2.0/rst/network_debug_troubleshooting.rst 312 | /usr/share/doc/ansible-doc-2.4.2.0/rst/playbook_pathing.rst 313 | /usr/share/doc/ansible-doc-2.4.2.0/rst/playbooks.rst 314 | /usr/share/doc/ansible-doc-2.4.2.0/rst/playbooks_acceleration.rst 315 | /usr/share/doc/ansible-doc-2.4.2.0/rst/playbooks_advanced_syntax.rst 316 | /usr/share/doc/ansible-doc-2.4.2.0/rst/playbooks_async.rst 317 | /usr/share/doc/ansible-doc-2.4.2.0/rst/playbooks_best_practices.rst 318 | /usr/share/doc/ansible-doc-2.4.2.0/rst/playbooks_blocks.rst 319 | /usr/share/doc/ansible-doc-2.4.2.0/rst/playbooks_checkmode.rst 320 | /usr/share/doc/ansible-doc-2.4.2.0/rst/playbooks_conditionals.rst 321 | /usr/share/doc/ansible-doc-2.4.2.0/rst/playbooks_debugger.rst 322 | /usr/share/doc/ansible-doc-2.4.2.0/rst/playbooks_delegation.rst 323 | /usr/share/doc/ansible-doc-2.4.2.0/rst/playbooks_environment.rst 324 | /usr/share/doc/ansible-doc-2.4.2.0/rst/playbooks_error_handling.rst 325 | /usr/share/doc/ansible-doc-2.4.2.0/rst/playbooks_filters.rst 326 | /usr/share/doc/ansible-doc-2.4.2.0/rst/playbooks_filters_ipaddr.rst 327 | /usr/share/doc/ansible-doc-2.4.2.0/rst/playbooks_intro.rst 328 | /usr/share/doc/ansible-doc-2.4.2.0/rst/playbooks_lookups.rst 329 | /usr/share/doc/ansible-doc-2.4.2.0/rst/playbooks_loops.rst 330 | /usr/share/doc/ansible-doc-2.4.2.0/rst/playbooks_prompts.rst 331 | /usr/share/doc/ansible-doc-2.4.2.0/rst/playbooks_python_version.rst 332 | /usr/share/doc/ansible-doc-2.4.2.0/rst/playbooks_reuse.rst 333 | /usr/share/doc/ansible-doc-2.4.2.0/rst/playbooks_reuse_includes.rst 334 | /usr/share/doc/ansible-doc-2.4.2.0/rst/playbooks_reuse_roles.rst 335 | /usr/share/doc/ansible-doc-2.4.2.0/rst/playbooks_roles.rst 336 | /usr/share/doc/ansible-doc-2.4.2.0/rst/playbooks_special_topics.rst 337 | /usr/share/doc/ansible-doc-2.4.2.0/rst/playbooks_startnstep.rst 338 | /usr/share/doc/ansible-doc-2.4.2.0/rst/playbooks_strategies.rst 339 | /usr/share/doc/ansible-doc-2.4.2.0/rst/playbooks_tags.rst 340 | /usr/share/doc/ansible-doc-2.4.2.0/rst/playbooks_templating.rst 341 | /usr/share/doc/ansible-doc-2.4.2.0/rst/playbooks_tests.rst 342 | /usr/share/doc/ansible-doc-2.4.2.0/rst/playbooks_variables.rst 343 | /usr/share/doc/ansible-doc-2.4.2.0/rst/playbooks_vault.rst 344 | /usr/share/doc/ansible-doc-2.4.2.0/rst/porting_guide_2.0.rst 345 | /usr/share/doc/ansible-doc-2.4.2.0/rst/porting_guide_2.3.rst 346 | /usr/share/doc/ansible-doc-2.4.2.0/rst/porting_guide_2.4.rst 347 | /usr/share/doc/ansible-doc-2.4.2.0/rst/porting_guides.rst 348 | /usr/share/doc/ansible-doc-2.4.2.0/rst/python_3_support.rst 349 | /usr/share/doc/ansible-doc-2.4.2.0/rst/quickstart.rst 350 | /usr/share/doc/ansible-doc-2.4.2.0/rst/release_and_maintenance.rst 351 | /usr/share/doc/ansible-doc-2.4.2.0/rst/roadmap 352 | /usr/share/doc/ansible-doc-2.4.2.0/rst/roadmap/ROADMAP_2_1.rst 353 | /usr/share/doc/ansible-doc-2.4.2.0/rst/roadmap/ROADMAP_2_2.rst 354 | /usr/share/doc/ansible-doc-2.4.2.0/rst/roadmap/ROADMAP_2_3.rst 355 | /usr/share/doc/ansible-doc-2.4.2.0/rst/roadmap/ROADMAP_2_4.rst 356 | /usr/share/doc/ansible-doc-2.4.2.0/rst/test_strategies.rst 357 | /usr/share/doc/ansible-doc-2.4.2.0/rst/tower.rst 358 | /usr/share/doc/ansible-doc-2.4.2.0/rst/vault.rst 359 | ``` 360 | 361 | For jinja2 documentation, you can also look it up locally with elinks: 362 | ``` 363 | elinks file:///usr/share/doc/python-jinja2-2.7.2/html/templates.html 364 | ``` 365 | ## Installing Roles 366 | 367 | You can install from a tarball directly. Here is an example: 368 | 369 | ``` 370 | ansible-galaxy install https://github.com/monzell/ansible-lighttpd/archive/v0.1.tar.gz 371 | ``` 372 | 373 | Currently, ansible-galaxy does *not* install from zip archives. 374 | 375 | ## Verifying variables 376 | 377 | You can print out variables in `name`. This can be useful to verify that you are setting the right variables: 378 | 379 | ``` 380 | - hosts: all 381 | vars: 382 | filename: hellworld.txt 383 | tasks: 384 | - name: "We are copying file {{ filename }} to the instance" 385 | copy: 386 | src: "{{ filename }}" 387 | dest: "/tmp/{{ filename }}" 388 | ``` 389 | 390 | Note that this would probably not work for loop variables `item` as well as ansible facts. 391 | 392 | ## ansible configuration location 393 | 394 | Remember, ansible will read configuration variables in the following locations: 395 | 396 | - in ANSIBLE_CONFIG variable 397 | - in the current working directory 398 | - in .ansible.cfg in 399 | - in /etc/ansible/ansible.cfg 400 | 401 | To practice your ansible configuration, you can simply drop the config in the current working folder or home directory, rather than modifying the existing ansible.cfg in /etc/ansible. You can download the current config from the following location: 402 | 403 | https://raw.githubusercontent.com/ansible/ansible/devel/examples/ansible.cfg 404 | --------------------------------------------------------------------------------