FreeKB - Ansible articles
Ansible articles

Getting Started with Ansibleansible-doc commandGetting Started with the ansible-doc commandansible-doc becomeansible-doc connectionansible-doc inventoryansible-doc modulesansible-doc shellansible-doc strategyansible-playbook commandGetting Started with the ansible-playbook commandansible-playbook version commandansible command (ad-hoc task)Getting Started with the ansible commandansible --version commandAnsible GalaxyGetting Started with Ansible GalaxyAnsible Galaxy websiteansible-galaxy info commandansible-galaxy init commandansible-galaxy install commandansible-galaxy list commandansible-galaxy login commandansible-galaxy remove commandansible-galaxy search commandansible-galaxy setup commandansible-galaxy version commandAnsible Lintansible-lintAnsible Vault--vault-id command line option--vault-password-file command line optionAnsible Vault password fileansible-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 commandArraysGetting Started with Arrays Dictionary ListsAppend values to an Array Dictionary ListLooping through an Array Dictionary ListBecomeansible_become ansible_become_user ansible_become_pass variables (sudo)Become and --vault-password-file command line optionbecome command line (--become --become-user --become-method --ask-become-pass --become-flags)become directives in ansible.cfgbecome parameter (sudo)Understanding Become Privilege EscalationDry Run--check (dry run) command line flagFilesConfiguration file (ansible.cfg)FiltersGetting Started with Filtersb64decode filterb64encode filterfirst filter (first value in an array list)int filter (math)last filter (last value in an array list)lower filtermax filter (greatest value in array)min filter (lowest value in array)regex_escaperegex_findallregex_replaceregex_searchreplace filterround filtersort filtersplit (cut a string into pieces)upper filterHandlersHandlers NotifyHashesGetting Started with Hashes (key value pairs)Looping through an HashInstallInstall Ansible on Linux using pipInstall Ansible on Linux using yumInstall Ansible Tower on LinuxInstall ansible-lint on Linux using pipUninstall Ansible TowerInventory--list-hosts command line optionansible-inventory --graph commandansible-inventory --list commandDefining your inventoryRun a playbook against certain managed nodes (hosts -i --limit)Inventory (dynamic)Getting Started with the Dynamic Inventoryadvanced_host_list dynamic inventory pluginCobbler dynamic inventory scripthost_list dynamic inventory pluginini dynamic inventory pluginnmap dynamic inventory pluginvmware_vm_inventory dynamic inventory pluginyaml dynamic inventory pluginInventory (static)Create your own inventory fileDefault hosts fileInventory file format (INI YAML)Inventory groups (all | ungrouped | other)Jinja2Jinja2 templatingJSONGetting Started parsing JSONLoop through JSON arrayStore JSON value in variableLogsGetting Started with Logs (log_path)Magic VariablesGetting Started with Magic Variablesansible_date_time variableansible_default_ipv4.address magic variableansible_distribution magic variableansible_distribution_major_version magic variableansible_distribution_version magic variableansible_hostname (local server hostname)ansible_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)authorized_key moduleblockinfile module (edit file)command module (invoking a command)copy moduleCreate keypair using the user modulecron modulecurl moduledebug module (printing output to the console)fail when directory is not emptyfail when file or directory does not existfail when variable is emptyfail when variable is not definedfile 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 (delete remove file)file module (remove directory rmdir)find module (list files and directories)firewalld moduleget_url moduleimport_playbook moduleinclude_tasks moduleiptables moduleknown_hosts modulelineinfile module (edit file)mail module (send email)meta clear_host_errors module (continue fail fatal)move moduleopenssh_cert moduleopenssh_keypair 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)Module Utilitiesmodule_utilsParameterschanged_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 ignore_errors paramaterlocal_action parameterloop parameter (loop through items)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 items)with_list parameter (loop through items)with_nested loop parameterplaybooksGetting Started with playbooksPluginslookup plugin (read local file)lookup plugin (user whoami)Pythonansible command python versionansible_python_interpreter variableRetryRetry fileRolesGetting Started with RolesDownload role using the git clone commandpost_taskspre_tasksRole DependenciesRole DuplicationRole VariablesRoles with the when moduleSSHGetting Started with SSH--ask-pass (SSH) command line flag--connection command line flag/etc/ansible/hosts file SSHUsing an encrypted password with SSHTagsGetting Started with TagsTask ExecutionGetting Started with Task Execution--forks command line optionforks in ansible.cfgFree StrategyLinear StrategyparallelismTemplatesGetting Started with TemplatesTerminologyidempotentTowerGetting 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 revisionJob template extra variables in TowerRemove 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 variables--extra-vars (variables) command line optiongroup_vars variableplaybook_dir variableplay_hosts variableUpdate variable to lowercaseUpdate variable to uppercaseVariables in /etc/ansible/hosts or your own inventory filevars parameter (variables, arrays, lists)