FreeKB - Ansible articles
Ansible articles

Getting Started with Ansibleansible-doc commandGetting Started with the ansible-doc commandansible-doc becomeansible-doc inventoryansible-doc modulesansible-doc shellansible-doc strategyansible-galaxy commandansible-galaxy init commandansible-galaxy install commandansible-galaxy list commandansible-galaxy remove commandansible-galaxy version commandansible-playbook commandGetting Started with the ansible-playbook commandansible-playbook version commandansible-vault commandansible-vault create commandansible-vault decrypt commandansible-vault edit commandansible-vault encrypt command ansible-vault encrypt_string commandansible-vault rekey command (change password)ansible-vault view commandansible command (ad-hoc task)Getting Started with the ansible commandansible command versionAnsible GalaxyGetting Started with Ansible GalaxyAnsible Galaxy websiteAnsible Lintansible-lintArraysGetting Started with ArraysAppend values to an arrayCommand Line Options and Flags--ask-pass (SSH) command line flag--check (dry run) command line flag--extra-vars (variables) command line option--forks command line option--limit (limit target servers hosts) command line option--list-hosts command line optionbecome command line (--become --become-user --become-method --ask-become-pass --become-flags)Connection Variablesansible_become ansible_become_user ansible_become_pass variables (sudo)ansible_date_time variableansible_hostname (local server hostname)Variables in /etc/ansible/hosts or your own inventory fileFiles/etc/ansible/hosts file SSHConfiguration file (ansible.cfg)FiltersGetting Started with Filtersint filter (integers)last filterlower filtermax filtermin filterregex_replaceregex_searchsort filtersplit (cut a string into pieces)upper filterHandlersHandlers NotifyInstallInstall Ansible on Linux using pipInstall Ansible on Linux using yumInstall Ansible Tower on LinuxInstall ansible-lint on Linux using pipUninstall Ansible TowerInventoryansible-inventory --graph commandansible-inventory --list commandInventory (dynamic)Getting Started with the Dynamic Inventory Pluginadvanced_host_list inventory pluginhost_list inventory pluginini inventory pluginnmap inventory pluginvmware_vm_inventory Pluginyaml inventory pluginInventory (static)Getting Started with Static Inventory (managed nodes / hosts)Inventory file format (INI vs YAML)Inventory groups (all | unmanaged | other)Jinja2Jinja2 templatingJSONGetting Started parsing JSONLoop through JSON arrayStore JSON value in variableLogsGetting Started with Logs (log_path)Magic VariablesGetting Started with Magic Variablesansible_default_ipv4.address magic variableansible_distribution magic variableansible_distribution_major_version magic variableansible_distribution_version magic variableansible_limit magic variableansible_play_batch magic variableansible_play_hosts magic variableansible_play_hosts_all magic variablehostvars magic variableinventory_hostname magic variable (managed node hostname)inventory_hostname_short magic variable (managed node hostname)Modulesarchive module (tar zip bzip2 gzip)blockinfile module (edit file)command module (invoking a command)copy modulecron modulecurl moduledebug module (printing output to the console)fail module (skip tasks)file module (change owner group mode permissions chown chgrp chmod)file module (create a symbolic link symlink soft link)file module (create directory mkdir)file module (create file touch)file module (remove directory rmdir)file module (remove file)find module (list files and directories)firewalld moduleget_url moduleimport_playbook moduleinclude_tasks moduleiptables modulelineinfile module (edit file)mail module (send email)meta clear_host_errors module (continue fail fatal)move moduleping moduleraw module (execute a command)rename modulereplace module (edit a file)script module (invoking a script)service module (start stop restart services chkconfig)setup module (gather facts)set_fact moduleset_fact module (array of values)shell module (invoking a shell command)shell module (write local file)slurp module (read file)stat module (file statistics)systemd module (start stop restart services)unarchive module (tar zip bzip2 gzip)uri moduleuser moduleyum module (install update package)yum module (list available installed packages)Parametersbecome parameter (root, sudo)changed_when parameter check_mode parameter (dry run)connection parameterdelay parameter delegate_to parameter (run task on specific server)end_play parameter failed_when parameter (skip tasks)gather_facts parametergroup parameter local_action parameterloop parameter (loop through array)mode parameter module_defaults parameterowner parameter recurse parameterregister parameter (stdout stderr rc)remote_src parameterremote_user parameterretries parameter run_once parameterselevel parameter (SELinux)serole parameter (SELinux)setype parameter (SELinux)seuser parameter (SELinux)until parameter (loop)validate parameterwarnings parameter (warn: true, warn: false)when parameter (if else statement)when x.stat.exists parameter (determine if a file or directory exists)when x.stat.isdir parameter (determine if object is a directory)with_items parameter (loop through array)with_nested loop parameterplaybooksGetting Started with playbooksPluginslookup plugin (read local file)Pythonansible command python versionansible_python_interpreter variableRegular Expressions (regex)escape wildcard in Regular Expressions (regex)RetryRetry fileRolesGetting Started with Rolespost_taskspre_tasksRole DependenciesRole DuplicationRole VariablesRoles with the when moduleSSHGetting Started with SSHUsing an encrypted password with SSHStrategiesFree StrategyLinear StrategyTagsGetting Started with TagsTemplatesGetting Started with TemplatesTerminologyidempotentparallelismTowerGetting Started with TowerAdd managed hosts to static inventory in TowerCreate Job Schedule in TowerCreate Job Template in TowerCreate Project in TowerCreate static Inventory in TowerDelete Job Template in TowerDelete Project in TowerDelete static Inventory in TowerGet latest SCM revisionRemove managed hosts to static inventory in TowerStart Job Template in TowerStart Stop Restart Ansible TowerViewing Completed JobsTroubleshootingResolve "Destination not writable"Resolve "Failed to connect to the host via ssh Permission denied"Resolve "Failed to parse foo.yml with foo plugin"Resolve "non-zero return code"Resolve "There was an issue creating as requested: [Erroro 13] Permission denied"VariablesGetting Started with variablesgroup_vars variableplay_hosts variableUpdate variable to lowercaseUpdate variable to uppercasevars parameter (variables, arrays, lists)