Ansible Essentials Workshop

What You Will Learn

Ansible is capable of handling many powerful automation tasks with the flexibility to adapt to many environments and workflows. With Ansible, users can very quickly get up and running to do real work.

  • What is Ansible? / "The Ansible Way"
  • How Ansible Works and its Key Components
  • Automating with Ad-Hoc Commands
  • Writing Playbooks / Playbook Basics
  • Reuse and Redistribution of Ansible Content with Roles

What is Ansible?

It's a simple automation language that can perfectly describe an IT application infrastructure in Ansible Playbooks.

It's an automation engine that runs Ansible Playbooks.


Ansible is an automation platform:

  • Playbooks make up the automation language
  • The code base is the automation engine.
  • Ansible Tower manages existing automation

What is Ansible Tower?

Ansible Tower is an enterprise framework for controlling, securing and managing your Ansible automation with a UI and RESTful API.

Why Ansible?    What Sets Ansible Apart?

Why Ansible?    What Sets Ansible Apart?

Why Ansible?    What Sets Ansible Apart?

Why Ansible?    What Sets Ansible Apart?

Ansible Provides End To End Goodness

 
 

The Ansible Way


CROSS PLATFORM – Linux, Windows, UNIX
Agentless support for all major OS variants, physical, virtual, cloud and network

HUMAN READABLE – YAML
Perfectly describe and document every aspect of your application environment

PERFECT DESCRIPTION OF APPLICATION
Every change can be made by playbooks, ensuring everyone is on the same page

VERSION CONTROLLED
Playbooks are plain-text. Treat them like code in your existing version control.

DYNAMIC INVENTORIES
Capture all the servers 100% of the time, regardless of infrastructure, location, etc.

ORCHESTRATION THAT PLAYS WELL WITH OTHERS – HP SA, Puppet, Jenkins, RHNSS, etc. Homogenize existing environments by leveraging current toolsets and update mechanisms.

The Ansible Way - Venture Across The Platform


CROSS PLATFORM – Linux, Windows, UNIX
Agentless support for all major OS variants, physical, virtual, cloud and network

HUMAN READABLE – YAML
Perfectly describe and document every aspect of your application environment

PERFECT DESCRIPTION OF APPLICATION
Every change can be made by playbooks, ensuring everyone is on the same page

VERSION CONTROLLED
Playbooks are plain-text. Treat them like code in your existing version control.

DYNAMIC INVENTORIES
Capture all the servers 100% of the time, regardless of infrastructure, location, etc.

ORCHESTRATION THAT PLAYS WELL WITH OTHERS – HP SA, Puppet, Jenkins, RHNSS, etc. Homogenize existing environments by leveraging current toolsets and update mechanisms.

The Ansible Way - Communicate Clearly


CROSS PLATFORM – Linux, Windows, UNIX
Agentless support for all major OS variants, physical, virtual, cloud and network

HUMAN READABLE – YAML
Perfectly describe and document every aspect of your application environment

PERFECT DESCRIPTION OF APPLICATION
Every change can be made by playbooks, ensuring everyone is on the same page

VERSION CONTROLLED
Playbooks are plain-text. Treat them like code in your existing version control.

DYNAMIC INVENTORIES
Capture all the servers 100% of the time, regardless of infrastructure, location, etc.

ORCHESTRATION THAT PLAYS WELL WITH OTHERS – HP SA, Puppet, Jenkins, RHNSS, etc. Homogenize existing environments by leveraging current toolsets and update mechanisms.

The Ansible Way - One Source To Rule Them All


CROSS PLATFORM – Linux, Windows, UNIX
Agentless support for all major OS variants, physical, virtual, cloud and network

HUMAN READABLE – YAML
Perfectly describe and document every aspect of your application environment

PERFECT DESCRIPTION OF APPLICATION
Every change can be made by playbooks, ensuring everyone is on the same page

VERSION CONTROLLED
Playbooks are plain-text. Treat them like code in your existing version control.

DYNAMIC INVENTORIES
Capture all the servers 100% of the time, regardless of infrastructure, location, etc.

ORCHESTRATION THAT PLAYS WELL WITH OTHERS – HP SA, Puppet, Jenkins, RHNSS, etc. Homogenize existing environments by leveraging current toolsets and update mechanisms.

The Ansible Way - Version Controlled Goodness


CROSS PLATFORM – Linux, Windows, UNIX
Agentless support for all major OS variants, physical, virtual, cloud and network

HUMAN READABLE – YAML
Perfectly describe and document every aspect of your application environment

PERFECT DESCRIPTION OF APPLICATION
Every change can be made by playbooks, ensuring everyone is on the same page

VERSION CONTROLLED
Playbooks are plain-text. Treat them like code in your existing version control.

DYNAMIC INVENTORIES
Capture all the servers 100% of the time, regardless of infrastructure, location, etc.

ORCHESTRATION THAT PLAYS WELL WITH OTHERS – HP SA, Puppet, Jenkins, RHNSS, etc. Homogenize existing environments by leveraging current toolsets and update mechanisms.

The Ansible Way - Dynamically Utilize Inventories


CROSS PLATFORM – Linux, Windows, UNIX
Agentless support for all major OS variants, physical, virtual, cloud and network

HUMAN READABLE – YAML
Perfectly describe and document every aspect of your application environment

PERFECT DESCRIPTION OF APPLICATION
Every change can be made by playbooks, ensuring everyone is on the same page

VERSION CONTROLLED
Playbooks are plain-text. Treat them like code in your existing version control.

DYNAMIC INVENTORIES
Capture all the servers 100% of the time, regardless of infrastructure, location, etc.

ORCHESTRATION THAT PLAYS WELL WITH OTHERS – HP SA, Puppet, Jenkins, RHNSS, etc. Homogenize existing environments by leveraging current toolsets and update mechanisms.

The Ansible Way - Play Nicely With Others


CROSS PLATFORM – Linux, Windows, UNIX
Agentless support for all major OS variants, physical, virtual, cloud and network

HUMAN READABLE – YAML
Perfectly describe and document every aspect of your application environment

PERFECT DESCRIPTION OF APPLICATION
Every change can be made by playbooks, ensuring everyone is on the same page

VERSION CONTROLLED
Playbooks are plain-text. Treat them like code in your existing version control.

DYNAMIC INVENTORIES
Capture all the servers 100% of the time, regardless of infrastructure, location, etc.

ORCHESTRATION THAT PLAYS WELL WITH OTHERS – HP SA, Puppet, Jenkins, RHNSS, etc. Homogenize existing environments by leveraging current toolsets and update mechanisms.

Batteries Included

Ansible comes bundled with hundreds of modules for a wide variety of automation tasks

  • cloud
  • containers
  • database
  • files
  • messaging
  • monitoring
  • network
  • notifications
  • packaging
  • source control
  • system
  • testing
  • utilities
  • web infrastructure

Ansible: The Language of DevOps

COMMUNICATION IS THE KEY TO DEVOPS.

Ansible is the first automation language
that can be read and written across IT.

Ansible is the only automation engine
that can automate the entire application lifecycle
and continuous delivery pipeline.

Ansible: Endless Use Cases

Ansible fills virtually countless use cases with its versatility.

  • ✾  Ansible is NOT just a Config Management Tool.
  • ☇  Ansible is NOT just an Application Deployment Tool.
  • ☁  Ansible is NOT just a Provisioning Tool.
  • ☡  Ansible is NOT just a CI/CD Tool.
  • ✎  Ansible is NOT just an Audit and Compliance Tool.
  • ➰   Ansible is NOT just an Orchestration Tool.
  • Ansible is a powerful automation engine...

    with strong use cases for all of the above tasks.

    PEOPLE LOVE ANSIBLE.

    Ansible is taking the world by storm with unbelievable popularity.

    33,500+

    Stars on GitHub

    2100+

    Ansible Modules

    500,000+

    Downloads Per Month

    INSTALLING ANSIBLE

    It Could Not Be Simpler.

    Ansible Terminal
    # RHEL "extras" repo or CentOS EPEL:
    $ sudo yum install ansible
    
    # you will need the PPA repo configured on
    # Debian or Ubuntu
    $ sudo apt-get install ansible
    
    # from your MacBook:
    $ brew install ansible
    
    # For bleeding edge python versions,
    $ sudo pip install ansible
        

    Simple: Installing Ansible

    HOW ANSIBLE WORKS

    Let's Take A Look At The Technology

    How Ansible Works

    Plays & Playbooks

    Modules & Tasks

    Plugins

    Inventory

    Inventory

    MODULES

    We leverage modules within our playbooks to do the heavy lifting.

    Modules

    Modules are bits of code transferred to the target system and executed to satisfy the task declaration.

    • apt/yum
    • copy
    • file
    • get_url
    • git
    • ping
    • debug
    • service
    • synchronize
    • template
    • uri
    • user
    • wait_for
    • assert

    Modules Documentation

    Returns a list of literally every module available on the system

    [ansible@redhat] $ ansible-doc -l
    Provides a long list of all available modules
    
    
    a10_server Manage A10 Networks AX... a10_server_axapi3 Manage A10 Networks AX... a10_service_group Manage A10 Networks AX... a10_virtual_server Manage A10 Networks AX... accelerate Enable accelerated mod... aci_aaa_user Manage AAA users (aaa:... aci_aaa_user_certificate Manage AAA user certif... aci_access_port_to_interface_policy_leaf_profile Manage Fabric interfac... aci_aep Manage attachable Acce... aci_aep_to_domain Bind AEPs to Physical ... aci_ap Manage top level Appli... aci_bd Manage Bridge Domains ... aci_bd_subnet Manage Subnets (fv:Sub... aci_bd_to_l3out Bind Bridge Domain to ... aci_config_rollback Provides rollback and ... aci_config_snapshot Manage Config Snapshot... aci_contract Manage contract resour... aci_contract_subject Manage initial Contrac... aci_contract_subject_to_filter Bind Contract Subjects... aci_domain Manage physical, virtu... aci_domain_to_encap_pool Bind Domain to Encap P... aci_domain_to_vlan_pool Bind Domain to VLAN Po... aci_encap_pool Manage encap pools (fv... aci_encap_pool_range Manage encap ranges as... aci_epg Manage End Point Group... aci_epg_monitoring_policy Manage monitoring poli... aci_epg_to_contract Bind EPGs to Contracts... aci_epg_to_domain Bind EPGs to Domains (... aci_fabric_node Manage Fabric Node Mem... aci_filter Manages top level filt... aci_filter_entry Manage filter entries ... aci_firmware_source Manage firmware image ... aci_interface_policy_fc Manage Fibre Channel i... aci_interface_policy_l2 Manage Layer 2 interfa... aci_interface_policy_leaf_policy_group Manage fabric interfac... aci_interface_policy_leaf_profile Manage fabric interfac... aci_interface_policy_lldp Manage LLDP interface ... aci_interface_policy_mcp Manage MCP interface p... aci_interface_policy_port_channel Manage port channel in... aci_interface_policy_port_security Manage port security (... aci_interface_selector_to_switch_policy_leaf_profile Bind interface selecto... aci_l3out Manage Layer 3 Outside... aci_l3out_route_tag_policy Manage route tag polic... aci_rest Direct access to the C... aci_static_binding_to_epg Bind static paths to E... aci_switch_leaf_selector Bind leaf selectors to... aci_switch_policy_leaf_profile Manage switch policy l... aci_switch_policy_vpc_protection_group Manage switch policy e... aci_taboo_contract Manage taboo contracts... aci_tenant Manage tenants (fv:Ten... aci_tenant_action_rule_profile Manage action rule pro... aci_tenant_ep_retention_policy Manage End Point (EP) ... aci_tenant_span_dst_group Manage SPAN destinatio... aci_tenant_span_src_group Manage SPAN source gro... aci_tenant_span_src_group_to_dst_group Bind SPAN source group... aci_vlan_pool Manage VLAN pools (fvn... aci_vlan_pool_encap_block Manage encap blocks as... aci_vrf Manage contexts or VRF... acl Sets and retrieves fil... acme_account Create, modify or dele... acme_certificate Create SSL certificate... add_host add a host (and altern... airbrake_deployment Notify airbrake about ... aireos_command Run commands on remote... aireos_config Manage Cisco WLC confi... aix_inittab Manages the inittab on... aix_lvol Configure AIX LVM logi... alternatives Manages alternative pr... aos_asn_pool Manage AOS ASN Pool aos_blueprint Manage AOS blueprint i... aos_blueprint_param Manage AOS blueprint p... aos_blueprint_virtnet Manage AOS blueprint p... aos_device Manage Devices on AOS ... aos_external_router Manage AOS External Ro... aos_ip_pool Manage AOS IP Pool aos_logical_device Manage AOS Logical Dev... aos_logical_device_map Manage AOS Logical Dev... aos_login Login to AOS server fo... aos_rack_type Manage AOS Rack Type aos_template Manage AOS Template apache2_mod_proxy Set and/or get members... apache2_module Enables/disables a mod... apk Manages apk packages apt Manages apt-packages apt_key Add or remove an apt k... apt_repository Add and remove APT rep... apt_rpm apt_rpm package manage... archive Creates a compressed a... aruba_command Run commands on remote... aruba_config Manage Aruba configura... asa_acl Manage access-lists on... asa_command Run arbitrary commands... asa_config Manage configuration s... assemble Assembles a configurat... assert Asserts given expressi... async_status Obtain status of async... at Schedule the execution... atomic_container Manage the containers ... atomic_host Manage the atomic host... atomic_image Manage the container i... authorized_key Adds or removes an SSH... avi_actiongroupconfig Module for setup of Ac... avi_alertconfig Module for setup of Al... avi_alertemailconfig Module for setup of Al... avi_alertscriptconfig Module for setup of Al... avi_alertsyslogconfig Module for setup of Al... avi_analyticsprofile Module for setup of An... avi_api_session Avi API Module avi_api_version Avi API Version Module avi_applicationpersistenceprofile Module for setup of Ap... avi_applicationprofile Module for setup of Ap... avi_authprofile Module for setup of Au... avi_autoscalelaunchconfig Module for setup of Au... avi_backup Module for setup of Ba... avi_backupconfiguration Module for setup of Ba... avi_certificatemanagementprofile Module for setup of Ce... avi_cloud Module for setup of Cl... avi_cloudconnectoruser Module for setup of Cl... avi_cloudproperties Module for setup of Cl... avi_cluster Module for setup of Cl... avi_clusterclouddetails Module for setup of Cl... avi_controllerproperties Module for setup of Co... avi_customipamdnsprofile Module for setup of Cu... avi_dnspolicy Module for setup of Dn... avi_errorpagebody Module for setup of Er... avi_errorpageprofile Module for setup of Er... avi_gslb Module for setup of Gs... avi_gslbapplicationpersistenceprofile Module for setup of Gs... avi_gslbgeodbprofile Module for setup of Gs... avi_gslbhealthmonitor Module for setup of Gs... avi_gslbservice Module for setup of Gs... avi_gslbservice_patch_member Avi API Module avi_hardwaresecuritymodulegroup Module for setup of Ha... avi_healthmonitor Module for setup of He... avi_httppolicyset Module for setup of HT... avi_ipaddrgroup Module for setup of Ip... avi_ipamdnsproviderprofile Module for setup of Ip... avi_l4policyset Module for setup of L4... avi_microservicegroup Module for setup of Mi... avi_network Module for setup of Ne... avi_networkprofile Module for setup of Ne... avi_networksecuritypolicy Module for setup of Ne... avi_pkiprofile Module for setup of PK... avi_pool Module for setup of Po... avi_poolgroup Module for setup of Po... avi_poolgroupdeploymentpolicy Module for setup of Po... avi_prioritylabels Module for setup of Pr... avi_role Module for setup of Ro... avi_scheduler Module for setup of Sc... avi_seproperties Module for setup of Se... avi_serverautoscalepolicy Module for setup of Se... avi_serviceengine Module for setup of Se... avi_serviceenginegroup Module for setup of Se... avi_snmptrapprofile Module for setup of Sn... avi_sslkeyandcertificate Module for setup of SS... avi_sslprofile Module for setup of SS... avi_stringgroup Module for setup of St... avi_systemconfiguration Module for setup of Sy... avi_tenant Module for setup of Te... avi_trafficcloneprofile Module for setup of Tr... avi_useraccount Avi UserAccount Module avi_useraccountprofile Module for setup of Us... avi_virtualservice Module for setup of Vi... avi_vrfcontext Module for setup of Vr... avi_vsdatascriptset Module for setup of VS... avi_vsvip Module for setup of Vs... avi_wafpolicy Module for setup of Wa... avi_wafprofile Module for setup of Wa... avi_webhook Module for setup of We... awall Manage awall policies aws_acm_facts Retrieve certificate f... aws_api_gateway Manage AWS API Gateway... aws_application_scaling_policy Manage Application Aut... aws_az_facts Gather facts about ava... aws_batch_compute_environment Manage AWS Batch Compu... aws_batch_job_definition Manage AWS Batch Job D... aws_batch_job_queue Manage AWS Batch Job Q... aws_caller_facts Get facts about the us... aws_config_aggregation_authorization Manage cross-account A... aws_config_aggregator Manage AWS Config aggr... aws_config_delivery_channel Manage AWS Config deli... aws_config_recorder Manage AWS Config Reco... aws_config_rule Manage AWS Config reso... aws_direct_connect_connection Creates, deletes, modi... aws_direct_connect_gateway Manage AWS Direct Conn... aws_direct_connect_link_aggregation_group Manage Direct Connect ... aws_direct_connect_virtual_interface Manage Direct Connect ... aws_elasticbeanstalk_app create, update, and de... aws_glue_connection Manage an AWS Glue con... aws_glue_job Manage an AWS Glue job aws_inspector_target Create, Update and Del... aws_kms Perform various KMS ma... aws_kms_facts Gather facts about AWS... aws_region_facts Gather facts about AWS... aws_s3 manage objects in S3. aws_s3_bucket_facts Lists S3 buckets in AW... aws_s3_cors Manage CORS for S3 buc... aws_ses_identity Manages SES email and ... aws_ses_identity_policy Manages SES sending au... aws_sgw_facts Fetch AWS Storage Gate... aws_ssm_parameter_store Manage key-value pairs... aws_waf_condition create and delete WAF ... aws_waf_facts Retrieve facts for WAF... aws_waf_rule create and delete WAF ... aws_waf_web_acl create and delete WAF ... azure create or terminate a ... azure_rm_acs Manage an Azure Contai... azure_rm_aks Manage a managed Azure... azure_rm_aks_facts Get Azure Kubernetes S... azure_rm_availabilityset Manage Azure availabil... azure_rm_availabilityset_facts Get availability set f... azure_rm_containerinstance Manage an Azure Contai... azure_rm_containerregistry Manage an Azure Contai... azure_rm_deployment Create or destroy Azur... azure_rm_dnsrecordset Create, delete and upd... azure_rm_dnsrecordset_facts Get DNS Record Set fac... azure_rm_dnszone Manage Azure DNS zones... azure_rm_dnszone_facts Get DNS zone facts. azure_rm_functionapp Manage Azure Function ... azure_rm_functionapp_facts Get Azure Function App... azure_rm_image Manage Azure image. azure_rm_keyvault Manage Key Vault insta... azure_rm_keyvaultkey Use Azure KeyVault key... azure_rm_keyvaultsecret Use Azure KeyVault Sec... azure_rm_loadbalancer Manage Azure load bala... azure_rm_loadbalancer_facts Get load balancer fact... azure_rm_managed_disk Manage Azure Manage Di... azure_rm_managed_disk_facts Get managed disk facts... azure_rm_mysqldatabase Manage MySQL Database ... azure_rm_mysqlserver Manage MySQL Server in... azure_rm_networkinterface Manage Azure network i... azure_rm_networkinterface_facts Get network interface ... azure_rm_postgresqldatabase Manage PostgreSQL Data... azure_rm_postgresqlserver Manage PostgreSQL Serv... azure_rm_publicipaddress Manage Azure Public IP... azure_rm_publicipaddress_facts Get public IP facts. azure_rm_resource Create any Azure resou... azure_rm_resource_facts Generic facts of Azure... azure_rm_resourcegroup Manage Azure resource ... azure_rm_resourcegroup_facts Get resource group fac... azure_rm_securitygroup Manage Azure network s... azure_rm_securitygroup_facts Get security group fac... azure_rm_sqldatabase Manage SQL Database in... azure_rm_sqlserver Manage SQL Server inst... azure_rm_sqlserver_facts Get SQL Server facts. azure_rm_storageaccount Manage Azure storage a... azure_rm_storageaccount_facts Get storage account fa... azure_rm_storageblob Manage blob containers... azure_rm_subnet Manage Azure subnets. azure_rm_virtualmachine Manage Azure virtual m... azure_rm_virtualmachine_extension Managed Azure Virtual ... azure_rm_virtualmachine_scaleset Manage Azure virtual m... azure_rm_virtualmachine_scaleset_facts Get Virtual Machine Sc... azure_rm_virtualmachineimage_facts Get virtual machine im... azure_rm_virtualnetwork Manage Azure virtual n... azure_rm_virtualnetwork_facts Get virtual network fa... bcf_switch Create and remove a bc... beadm Manage ZFS boot enviro... bearychat Send BearyChat notific... bigip_asm_policy Manage BIG-IP ASM poli... bigip_command Run arbitrary command ... bigip_config Manage BIG-IP configur... bigip_configsync_action Perform different acti... bigip_data_group Manage data groups on ... bigip_device_connectivity Manages device IP conf... bigip_device_dns Manage BIG-IP device D... bigip_device_group Manage device groups o... bigip_device_group_member Manages members in a d... bigip_device_httpd Manage HTTPD related s... bigip_device_license Manage license install... bigip_device_ntp Manage NTP servers on ... bigip_device_sshd Manage the SSHD settin... bigip_device_trust Manage the trust relat... bigip_facts Collect facts from F5 ... bigip_gtm_datacenter Manage Datacenter conf... bigip_gtm_facts Collect facts from F5 ... bigip_gtm_global Manages global GTM set... bigip_gtm_monitor_bigip Manages F5 BIG-IP GTM ... bigip_gtm_monitor_external Manages external GTM m... bigip_gtm_monitor_firepass Manages F5 BIG-IP GTM ... bigip_gtm_monitor_http Manages F5 BIG-IP GTM ... bigip_gtm_monitor_https Manages F5 BIG-IP GTM ... bigip_gtm_monitor_tcp Manages F5 BIG-IP GTM ... bigip_gtm_monitor_tcp_half_open Manages F5 BIG-IP GTM ... bigip_gtm_pool Manages F5 BIG-IP GTM ... bigip_gtm_pool_member Manage GTM pool member... bigip_gtm_server Manages F5 BIG-IP GTM ... bigip_gtm_virtual_server Manages F5 BIG-IP GTM ... bigip_gtm_wide_ip Manages F5 BIG-IP GTM ... bigip_hostname Manage the hostname of... bigip_iapp_service Manages TCL iApp servi... bigip_iapp_template Manages TCL iApp templ... bigip_iapplx_package Manages Javascript iAp... bigip_irule Manage iRules across d... bigip_log_destination Manages log destinatio... bigip_log_publisher Manages log publishers... bigip_management_route Manage system manageme... bigip_monitor_external Manages external LTM m... bigip_monitor_http Manages F5 BIG-IP LTM ... bigip_monitor_https Manages F5 BIG-IP LTM ... bigip_monitor_snmp_dca Manages BIG-IP SNMP da... bigip_monitor_tcp Manages F5 BIG-IP LTM ... bigip_monitor_tcp_echo Manages F5 BIG-IP LTM ... bigip_monitor_tcp_half_open Manages F5 BIG-IP LTM ... bigip_monitor_udp Manages F5 BIG-IP LTM ... bigip_node Manages F5 BIG-IP LTM ... bigip_partition Manage BIG-IP partitio... bigip_policy Manage general policy ... bigip_policy_rule Manage LTM policy rule... bigip_pool Manages F5 BIG-IP LTM ... bigip_pool_member Manages F5 BIG-IP LTM ... bigip_profile_client_ssl Manages client SSL pro... bigip_profile_dns Manage DNS profiles on... bigip_profile_tcp Manage TCP profiles on... bigip_profile_udp Manage UDP profiles on... bigip_provision Manage BIG-IP module p... bigip_qkview Manage qkviews on the ... bigip_remote_syslog Manipulate remote sysl... bigip_routedomain Manage route domains o... bigip_security_address_list Manage address lists o... bigip_security_port_list Manage port lists on B... bigip_selfip Manage Self-IPs on a B... bigip_service_policy Manages service polici... bigip_smtp Manages SMTP settings ... bigip_snat_pool Manage SNAT pools on a... bigip_snmp Manipulate general SNM... bigip_snmp_community Manages SNMP communiti... bigip_snmp_trap Manipulate SNMP trap i... bigip_software_update Manage the software up... bigip_ssl_certificate Import/Delete certific... bigip_ssl_key Import/Delete SSL keys... bigip_static_route Manipulate static rout... bigip_sys_db Manage BIG-IP system d... bigip_sys_global Manage BIG-IP global s... bigip_timer_policy Manage timer policies ... bigip_traffic_group Manages traffic groups... bigip_trunk Manage trunks on a BIG... bigip_ucs Manage upload, install... bigip_ucs_fetch Fetches a UCS file fro... bigip_user Manage user accounts a... bigip_vcmp_guest Manages vCMP guests on... bigip_virtual_address Manage LTM virtual add... bigip_virtual_server Manage LTM virtual ser... bigip_vlan Manage VLANs on a BIG-... bigip_wait Wait for a BIG-IP cond... bigiq_application_fasthttp Manages BIG-IQ FastHTT... bigiq_application_fastl4_tcp Manages BIG-IQ FastL4 ... bigiq_application_fastl4_udp Manages BIG-IQ FastL4 ... bigiq_application_http Manages BIG-IQ HTTP ap... bigiq_application_https_offload Manages BIG-IQ HTTPS o... bigiq_application_https_waf Manages BIG-IQ HTTPS W... bigiq_regkey_license Manages licenses in a ... bigiq_regkey_license_assignment Manage regkey license ... bigiq_regkey_pool Manages registration k... bigiq_utility_license Manage utility license... bigmon_chain Create and remove a bi... bigmon_policy Create and remove a bi... bigpanda Notify BigPanda about ... blockinfile Insert/update/remove a... bower Manage bower packages ... bundler Manage Ruby Gem depend... bzr Deploy software (or fi... campfire Send a message to Camp... capabilities Manage Linux capabilit... catapult Send a sms / mms using... ce_aaa_server Manages AAA server glo... ce_aaa_server_host Manages AAA server hos... ce_acl Manages base ACL confi... ce_acl_advance Manages advanced ACL c... ce_acl_interface Manages applying ACLs ... ce_bfd_global Manages BFD global con... ce_bfd_session Manages BFD session co... ce_bfd_view Manages BFD session vi... ce_bgp Manages BGP configurat... ce_bgp_af Manages BGP Address-fa... ce_bgp_neighbor Manages BGP peer confi... ce_bgp_neighbor_af Manages BGP neighbor A... ce_command Run arbitrary command ... ce_config Manage Huawei CloudEng... ce_dldp Manages global DLDP co... ce_dldp_interface Manages interface DLDP... ce_eth_trunk Manages Eth-Trunk inte... ce_evpn_bd_vni Manages EVPN VXLAN Net... ce_evpn_bgp Manages BGP EVPN confi... ce_evpn_bgp_rr Manages RR for the VXL... ce_evpn_global Manages global configu... ce_facts Gets facts about HUAWE... ce_file_copy Copy a file to a remot... ce_info_center_debug Manages information ce... ce_info_center_global Manages outputting log... ce_info_center_log Manages information ce... ce_info_center_trap Manages information ce... ce_interface Manages physical attri... ce_interface_ospf Manages configuration ... ce_ip_interface Manages L3 attributes ... ce_link_status Get interface link sta... ce_mlag_config Manages MLAG configura... ce_mlag_interface Manages MLAG interface... ce_mtu Manages MTU settings o... ce_netconf Run an arbitrary netco... ce_netstream_aging Manages timeout mode o... ce_netstream_export Manages netstream expo... ce_netstream_global Manages global paramet... ce_netstream_template Manages NetStream temp... ce_ntp Manages core NTP confi... ce_ntp_auth Manages NTP authentica... ce_ospf Manages configuration ... ce_ospf_vrf Manages configuration ... ce_reboot Reboot a HUAWEI CloudE... ce_rollback Set a checkpoint or ro... ce_sflow Manages sFlow configur... ce_snmp_community Manages SNMP community... ce_snmp_contact Manages SNMP contact c... ce_snmp_location Manages SNMP location ... ce_snmp_target_host Manages SNMP target ho... ce_snmp_traps Manages SNMP traps con... ce_snmp_user Manages SNMP user conf... ce_startup Manages a system start... ce_static_route Manages static route c... ce_stp Manages STP configurat... ce_switchport Manages Layer 2 switch... ce_vlan Manages VLAN resources... ce_vrf Manages VPN instance o... ce_vrf_af Manages VPN instance a... ce_vrf_interface Manages interface spec... ce_vrrp Manages VRRP interface... ce_vxlan_arp Manages ARP attributes... ce_vxlan_gateway Manages gateway for th... ce_vxlan_global Manages global attribu... ce_vxlan_tunnel Manages VXLAN tunnel c... ce_vxlan_vap Manages VXLAN virtual ... circonus_annotation create an annotation i... cisco_spark Send a message to a Ci... cl_bond Configures a bond port... cl_bridge Configures a bridge po... cl_img_install Install a different Cu... cl_interface Configures a front pan... cl_interface_policy Configure interface en... cl_license Install licenses for C... cl_ports Configure Cumulus Swit... clc_aa_policy Create or Delete Anti ... clc_alert_policy Create or Delete Alert... clc_blueprint_package deploys a blue print p... clc_firewall_policy Create/delete/update f... clc_group Create/delete Server G... clc_loadbalancer Create, Delete shared ... clc_modify_server modify servers in Cent... clc_publicip Add and Delete public ... clc_server Create, Delete, Start ... clc_server_snapshot Create, Delete and Res... cloud_init_data_facts Retrieve facts of clou... cloudflare_dns manage Cloudflare DNS ... cloudformation Create or delete an AW... cloudformation_facts Obtain facts about an ... cloudfront_distribution create, update and del... cloudfront_facts Obtain facts about an ... cloudfront_invalidation create invalidations f... cloudfront_origin_access_identity create, update and del... cloudscale_floating_ip Manages floating IPs o... cloudscale_server Manages servers on the... cloudtrail manage CloudTrail crea... cloudwatchevent_rule Manage CloudWatch Even... cloudwatchlogs_log_group create or delete log_g... cloudwatchlogs_log_group_facts get facts about log_gr... cnos_backup Backup the current run... cnos_bgp Manage BGP resources a... cnos_command Run arbitrary commands... cnos_conditional_command Execute a single comma... cnos_conditional_template Manage switch configur... cnos_config Manage Lenovo CNOS con... cnos_factory Reset the switch's sta... cnos_facts Collect facts from rem... cnos_image Perform firmware upgra... cnos_interface Manage interface confi... cnos_portchannel Manage portchannel (po... cnos_reload Perform switch restart... cnos_rollback Roll back the running ... cnos_save Save the running confi... cnos_showrun Collect the current ru... cnos_template Manage switch configur... cnos_vlag Manage VLAG resources ... cnos_vlan Manage VLAN resources ... command Executes a command on ... composer Dependency Manager for... consul Add, modify & delete s... consul_acl Manipulate Consul ACL ... consul_kv Manipulate entries in ... consul_session Manipulate consul sess... copy Copies files to remote... cpanm Manages Perl library d... cron Manage cron.d and cron... cronvar Manage variables in cr... crypttab Encrypted Linux block ... cs_account Manages accounts on Ap... cs_affinitygroup Manages affinity group... cs_cluster Manages host clusters ... cs_configuration Manages configuration ... cs_domain Manages domains on Apa... cs_facts Gather facts on instan... cs_firewall Manages firewall rules... cs_host Manages hosts on Apach... cs_instance Manages instances and ... cs_instance_facts Gathering facts from t... cs_instance_nic Manages NICs of an ins... cs_instance_nic_secondaryip Manages secondary IPs ... cs_instancegroup Manages instance group... cs_ip_address Manages public IP addr... cs_iso Manages ISO images on ... cs_loadbalancer_rule Manages load balancer ... cs_loadbalancer_rule_member Manages load balancer ... cs_network Manages networks on Ap... cs_network_acl Manages network access... cs_network_acl_rule Manages network access... cs_network_offering Manages network offeri... cs_nic Manages NICs and secon... cs_pod Manages pods on Apache... cs_portforward Manages port forwardin... cs_project Manages projects on Ap... cs_region Manages regions on Apa... cs_resourcelimit Manages resource limit... cs_role Manages user roles on ... cs_role_permission Manages role permissio... cs_router Manages routers on Apa... cs_securitygroup Manages security group... cs_securitygroup_rule Manages security group... cs_service_offering Manages service offeri... cs_snapshot_policy Manages volume snapsho... cs_sshkeypair Manages SSH keys on Ap... cs_staticnat Manages static NATs on... cs_storage_pool Manages Primary Storag... cs_template Manages templates on A... cs_user Manages users on Apach... cs_vmsnapshot Manages VM snapshots o... cs_volume Manages volumes on Apa... cs_vpc Manages VPCs on Apache... cs_vpc_offering Manages vpc offerings ... cs_vpn_connection Manages site-to-site V... cs_vpn_customer_gateway Manages site-to-site V... cs_vpn_gateway Manages site-to-site V... cs_zone Manages zones on Apach... cs_zone_facts Gathering facts of zon... cv_server_provision Provision server port ... cyberark_authentication Module for CyberArk Va... cyberark_user Module for CyberArk Us... data_pipeline Create and manage AWS ... datadog_event Posts events to DataDo... datadog_monitor Manages Datadog monito... dconf Modify and read dconf ... debconf Configure a .deb packa... debug Print statements durin... dellos10_command Run commands on remote... dellos10_config Manage Dell EMC Networ... dellos10_facts Collect facts from rem... dellos6_command Run commands on remote... dellos6_config Manage Dell EMC Networ... dellos6_facts Collect facts from rem... dellos9_command Run commands on remote... dellos9_config Manage Dell EMC Networ... dellos9_facts Collect facts from rem... deploy_helper Manages some of the st... digital_ocean Create/delete a drople... digital_ocean_account_facts Gather facts about Dig... digital_ocean_block_storage Create/destroy or atta... digital_ocean_certificate Manage certificates in... digital_ocean_certificate_facts Gather facts about Dig... digital_ocean_domain Create/delete a DNS re... digital_ocean_domain_facts Gather facts about Dig... digital_ocean_floating_ip Manage DigitalOcean Fl... digital_ocean_floating_ip_facts DigitalOcean Floating ... digital_ocean_image_facts Gather facts about Dig... digital_ocean_load_balancer_facts Gather facts about Dig... digital_ocean_region_facts Gather facts about Dig... digital_ocean_size_facts Gather facts about Dig... digital_ocean_snapshot_facts Gather facts about Dig... digital_ocean_sshkey Manage DigitalOcean SS... digital_ocean_sshkey_facts DigitalOcean SSH keys ... digital_ocean_tag Create and remove tag(... digital_ocean_tag_facts Gather facts about Dig... digital_ocean_volume_facts Gather facts about Dig... dimensiondata_network Create, update, and de... dimensiondata_vlan Manage a VLAN in a Clo... django_manage Manages a Django appli... dladm_etherstub Manage etherstubs on S... dladm_iptun Manage IP tunnel inter... dladm_linkprop Manage link properties... dladm_vlan Manage VLAN interfaces... dladm_vnic Manage VNICs on Solari... dnf Manages packages with ... dnsimple Interface with dnsimpl... dnsmadeeasy Interface with dnsmade... docker manage docker containe... docker_container manage docker containe... docker_image Manage docker images. docker_image_facts Inspect docker images docker_login Log into a Docker regi... docker_network Manage Docker networks docker_secret Manage docker secrets. docker_service Manage docker services... docker_volume Manage Docker volumes dpkg_selections Dpkg package selection... dynamodb_table Create, update or dele... dynamodb_ttl set TTL for a given Dy... easy_install Installs Python librar... ec2 create, terminate, sta... ec2_ami create or destroy an i... ec2_ami_copy copies AMI between AWS... ec2_ami_facts Gather facts about ec2... ec2_ami_find Searches for AMIs to o... ec2_ami_search Retrieve AWS AMI infor... ec2_asg Create or delete AWS A... ec2_asg_facts Gather facts about ec2... ec2_asg_lifecycle_hook Create, delete or upda... ec2_customer_gateway Manage an AWS customer... ec2_customer_gateway_facts Gather facts about cus... ec2_eip manages EC2 elastic IP... ec2_eip_facts List EC2 EIP details ec2_elb De-registers or regist... ec2_elb_facts Gather facts about EC2... ec2_elb_lb Creates or destroys Am... ec2_eni Create and optionally ... ec2_eni_facts Gather facts about ec2... ec2_group maintain an ec2 VPC se... ec2_group_facts Gather facts about ec2... ec2_instance Create & manage EC2 in... ec2_instance_facts Gather facts about ec2... ec2_key create or delete an ec... ec2_lc Create or delete AWS A... ec2_lc_facts Gather facts about AWS... ec2_lc_find Find AWS Autoscaling L... ec2_metadata_facts Gathers facts (instanc... ec2_metric_alarm Create/update or delet... ec2_placement_group Create or delete an EC... ec2_placement_group_facts List EC2 Placement Gro... ec2_remote_facts Gather facts about ec2... ec2_scaling_policy Create or delete AWS s... ec2_snapshot creates a snapshot fro... ec2_snapshot_copy copies an EC2 snapshot... ec2_snapshot_facts Gather facts about ec2... ec2_tag create and remove tag(... ec2_vol create and attach a vo... ec2_vol_facts Gather facts about ec2... ec2_vpc configure AWS virtual ... ec2_vpc_dhcp_option Manages DHCP Options, ... ec2_vpc_dhcp_option_facts Gather facts about dhc... ec2_vpc_egress_igw Manage an AWS VPC Egre... ec2_vpc_endpoint Create and delete AWS ... ec2_vpc_endpoint_facts Retrieves AWS VPC endp... ec2_vpc_igw Manage an AWS VPC Inte... ec2_vpc_igw_facts Gather facts about int... ec2_vpc_nacl create and delete Netw... ec2_vpc_nacl_facts Gather facts about Net... ec2_vpc_nat_gateway Manage AWS VPC NAT Gat... ec2_vpc_nat_gateway_facts Retrieves AWS VPC Mana... ec2_vpc_net Configure AWS virtual ... ec2_vpc_net_facts Gather facts about ec2... ec2_vpc_peer create, delete, accept... ec2_vpc_peering_facts Retrieves AWS VPC Peer... ec2_vpc_route_table Manage route tables fo... ec2_vpc_route_table_facts Gather facts about ec2... ec2_vpc_subnet Manage subnets in AWS ... ec2_vpc_subnet_facts Gather facts about ec2... ec2_vpc_vgw Create and delete AWS ... ec2_vpc_vgw_facts Gather facts about vir... ec2_vpc_vpn Create, modify, and de... ec2_vpc_vpn_facts Gather facts about VPN... ec2_win_password gets the default admin... ecs_attribute manage ecs attributes ecs_cluster create or terminate ec... ecs_ecr Manage Elastic Contain... ecs_service create, terminate, sta... ecs_service_facts list or describe servi... ecs_task run, start or stop a t... ecs_taskdefinition register a task defini... ecs_taskdefinition_facts describe a task defini... edgeos_command Run one or more comman... edgeos_config Manage EdgeOS configur... edgeos_facts Collect facts from rem... efs create and maintain EF... efs_facts Get information about ... ejabberd_user Manages users for ejab... elasticache Manage cache clusters ... elasticache_facts Retrieve facts for AWS... elasticache_parameter_group Manage cache security ... elasticache_snapshot Manage cache snapshots... elasticache_subnet_group manage Elasticache sub... elasticsearch_plugin Manage Elasticsearch p... elb_application_lb Manage an Application ... elb_application_lb_facts Gather facts about app... elb_classic_lb Creates or destroys Am... elb_classic_lb_facts Gather facts about EC2... elb_instance De-registers or regist... elb_network_lb Manage a Network Load ... elb_target Manage a target in a t... elb_target_group Manage a target group ... elb_target_group_facts Gather facts about ELB... enos_command Run arbitrary commands... enos_config Manage Lenovo ENOS con... enos_facts Collect facts from rem... eos_banner Manage multiline banne... eos_command Run arbitrary commands... eos_config Manage Arista EOS conf... eos_eapi Manage and configure A... eos_facts Collect facts from rem... eos_interface Manage Interface on Ar... eos_l2_interface Manage L2 interfaces o... eos_l3_interface Manage L3 interfaces o... eos_linkagg Manage link aggregatio... eos_lldp Manage LLDP configurat... eos_logging Manage logging on netw... eos_static_route Manage static IP route... eos_system Manage the system attr... eos_user Manage the collection ... eos_vlan Manage VLANs on Arista... eos_vrf Manage VRFs on Arista ... etcd3 Set or delete key valu... execute_lambda Execute an AWS Lambda ... exo_dns_domain Manages domain records... exo_dns_record Manages DNS records on... exos_command Run commands on remote... expect Executes a command and... facter Runs the discovery pro... fail Fail with custom messa... fetch Fetches a file from re... file Sets attributes of fil... filesystem Makes a filesystem find Return a list of files... firewalld Manage arbitrary ports... flatpak Manage flatpaks flatpak_remote Manage flatpak reposit... flowadm Manage bandwidth resou... flowdock Send a message to a fl... fmgr_script Add/Edit/Delete and ex... foreman Manage Foreman Resourc... fortios_address Manage fortios firewal... fortios_config Manage config on Forti... fortios_ipv4_policy Manage IPv4 policy obj... fortios_webfilter Configure webfilter ca... gc_storage This module manages ob... gcdns_record Creates or removes res... gcdns_zone Creates or removes zon... gce create or terminate GC... gce_eip Create or Destroy Glob... gce_img utilize GCE image reso... gce_instance_template create or destroy inst... gce_labels Create, Update or Dest... gce_lb create/destroy GCE loa... gce_mig Create, Update or Dest... gce_net create/destroy GCE net... gce_pd utilize GCE persistent... gce_snapshot Create or destroy snap... gce_tag add or remove tag(s) t... gconftool2 Edit GNOME Configurati... gcp_backend_service Create or Destroy a Ba... gcp_compute_address Creates a GCP Address gcp_compute_backend_bucket Creates a GCP BackendB... gcp_compute_backend_service Creates a GCP BackendS... gcp_compute_disk Creates a GCP Disk gcp_compute_firewall Creates a GCP Firewall gcp_compute_forwarding_rule Creates a GCP Forwardi... gcp_compute_global_address Creates a GCP GlobalAd... gcp_compute_global_forwarding_rule Creates a GCP GlobalFo... gcp_compute_health_check Creates a GCP HealthCh... gcp_compute_http_health_check Creates a GCP HttpHeal... gcp_compute_https_health_check Creates a GCP HttpsHea... gcp_compute_image Creates a GCP Image gcp_compute_instance Creates a GCP Instance gcp_compute_instance_group Creates a GCP Instance... gcp_compute_instance_group_manager Creates a GCP Instance... gcp_compute_instance_template Creates a GCP Instance... gcp_compute_network Creates a GCP Network gcp_compute_route Creates a GCP Route gcp_compute_ssl_certificate Creates a GCP SslCerti... gcp_compute_subnetwork Creates a GCP Subnetwo... gcp_compute_target_http_proxy Creates a GCP TargetHt... gcp_compute_target_https_proxy Creates a GCP TargetHt... gcp_compute_target_pool Creates a GCP TargetPo... gcp_compute_target_ssl_proxy Creates a GCP TargetSs... gcp_compute_target_tcp_proxy Creates a GCP TargetTc... gcp_compute_url_map Creates a GCP UrlMap gcp_container_cluster Creates a GCP Cluster gcp_container_node_pool Creates a GCP NodePool gcp_dns_managed_zone Creates a GCP ManagedZ... gcp_dns_resource_record_set Creates a GCP Resource... gcp_forwarding_rule Create, Update or Dest... gcp_healthcheck Create, Update or Dest... gcp_pubsub_subscription Creates a GCP Subscrip... gcp_pubsub_topic Creates a GCP Topic gcp_storage_bucket Creates a GCP Bucket gcp_storage_bucket_access_control Creates a GCP BucketAc... gcp_target_proxy Create, Update or Dest... gcp_url_map Create, Update or Dest... gcpubsub Create and Delete Topi... gcpubsub_facts List Topics/Subscripti... gcspanner Create and Delete Inst... gem Manage Ruby gems get_url Downloads files from H... getent A wrapper to the unix ... git Deploy software (or fi... git_config Read and write git con... github_deploy_key Manages deploy keys fo... github_hooks Manages GitHub service... github_issue View GitHub issue. github_key Manage GitHub access k... github_release Interact with GitHub R... gitlab_deploy_key Manages GitLab project... gitlab_group Creates/updates/delete... gitlab_hooks Manages GitLab project... gitlab_project Creates/updates/delete... gitlab_user Creates/updates/delete... gluster_peer Attach/Detach peers to... gluster_volume Manage GlusterFS volum... grafana_dashboard Manage Grafana dashboa... grafana_datasource Manage Grafana datasou... grafana_plugin Manage Grafana plugins... group Add or remove groups group_by Create Ansible groups ... grove Sends a notification t... gunicorn Run gunicorn with vari... hall Send notification to H... haproxy Enable, disable, and s... helm Manages Kubernetes pac... heroku_collaborator Add or delete app coll... hg Manages Mercurial (hg)... hipchat Send a message to Hipc... homebrew Package manager for Ho... homebrew_cask Install/uninstall home... homebrew_tap Tap a Homebrew reposit... honeybadger_deployment Notify Honeybadger.io ... hostname Manage hostname hpilo_boot Boot system using spec... hpilo_facts Gather facts through a... hponcfg Configure HP iLO inter... htpasswd manage user files for ... iam Manage IAM users, grou... iam_cert Manage server certific... iam_group Manage AWS IAM groups iam_managed_policy Manage User Managed IA... iam_mfa_device_facts List the MFA (Multi-Fa... iam_policy Manage IAM policies fo... iam_role Manage AWS IAM roles iam_role_facts Gather information on ... iam_server_certificate_facts Retrieve the facts of ... iam_user Manage AWS IAM users icinga2_feature Manage Icinga2 feature icinga2_host Manage a host in Icing... imc_rest Manage Cisco IMC hardw... imgadm Manage SmartOS images import_playbook Import a playbook import_role Import a role into a p... import_tasks Import a task list include Include a play or task... include_role Load and execute a rol... include_tasks Dynamically include a ... include_vars Load variables from fi... infini_export Create, Delete or Modi... infini_export_client Create, Delete or Modi... infini_fs Create, Delete or Modi... infini_host Create, Delete and Mod... infini_pool Create, Delete and Mod... infini_vol Create, Delete or Modi... infinity manage Infinity IPAM u... influxdb_database Manage InfluxDB databa... influxdb_query Query data points from... influxdb_retention_policy Manage InfluxDB retent... influxdb_user Manage InfluxDB users influxdb_write Write data points into... ini_file Tweak settings in INI ... interfaces_file Tweak settings in /etc... ios_banner Manage multiline banne... ios_command Run commands on remote... ios_config Manage Cisco IOS confi... ios_facts Collect facts from rem... ios_interface Manage Interface on Ci... ios_l2_interface Manage Layer-2 interfa... ios_l3_interface Manage L3 interfaces o... ios_linkagg Manage link aggregatio... ios_lldp Manage LLDP configurat... ios_logging Manage logging on netw... ios_ping Tests reachability usi... ios_static_route Manage static IP route... ios_system Manage the system attr... ios_user Manage the aggregate o... ios_vlan Manage VLANs on IOS ne... ios_vrf Manage the collection ... iosxr_banner Manage multiline banne... iosxr_command Run commands on remote... iosxr_config Manage Cisco IOS XR co... iosxr_facts Collect facts from rem... iosxr_interface Manage Interface on Ci... iosxr_logging Configuration manageme... iosxr_netconf Configures NetConf sub... iosxr_system Manage the system attr... iosxr_user Manage the aggregate o... ip_netns Manage network namespa... ipa_dnsrecord Manage FreeIPA DNS rec... ipa_dnszone Manage FreeIPA DNS Zon... ipa_group Manage FreeIPA group ipa_hbacrule Manage FreeIPA HBAC ru... ipa_host Manage FreeIPA host ipa_hostgroup Manage FreeIPA host-gr... ipa_role Manage FreeIPA role ipa_service Manage FreeIPA service ipa_subca Manage FreeIPA Lightwe... ipa_sudocmd Manage FreeIPA sudo co... ipa_sudocmdgroup Manage FreeIPA sudo co... ipa_sudorule Manage FreeIPA sudo ru... ipa_user Manage FreeIPA users ipadm_addr Manage IP addresses on... ipadm_addrprop Manage IP address prop... ipadm_if Manage IP interfaces ... ipadm_ifprop Manage IP interface pr... ipadm_prop Manage protocol proper... ipify_facts Retrieve the public IP... ipinfoio_facts Retrieve IP geolocatio... ipmi_boot Management of order of... ipmi_power Power management for m... iptables Modify the systems ipt... irc Send a message to an I... ironware_command Run arbitrary commands... ironware_config Manage configuration s... ironware_facts Collect facts from dev... iso_extract Extract files from an ... jabber Send a message to jabb... java_cert Uses keytool to import... jboss deploy applications to... jenkins_job Manage jenkins jobs jenkins_job_facts Get facts about Jenkin... jenkins_plugin Add or remove Jenkins ... jenkins_script Executes a groovy scri... jira create and modify issu... junos_banner Manage multiline banne... junos_command Run arbitrary commands... junos_config Manage configuration o... junos_facts Collect facts from rem... junos_interface Manage Interface on Ju... junos_l2_interface Manage Layer-2 interfa... junos_l3_interface Manage L3 interfaces o... junos_linkagg Manage link aggregatio... junos_lldp Manage LLDP configurat... junos_lldp_interface Manage LLDP interfaces... junos_logging Manage logging on netw... junos_netconf Configures the Junos N... junos_package Installs packages on r... junos_rpc Runs an arbitrary RPC ... junos_scp Transfer files from or... junos_static_route Manage static IP route... junos_system Manage the system attr... junos_user Manage local user acco... junos_vlan Manage VLANs on Junipe... junos_vrf Manage the VRF definit... k8s Manage Kubernetes (K8s... k8s_scale Set a new size for a D... katello Manage Katello Resourc... kernel_blacklist Blacklist kernel modul... keycloak_client Allows administration ... keycloak_clienttemplate Allows administration ... kibana_plugin Manage Kibana plugins kinesis_stream Manage a Kinesis Strea... known_hosts Add or remove a host f... kubernetes Manage Kubernetes reso... lambda Manage AWS Lambda func... lambda_alias Creates, updates or de... lambda_event Creates, updates or de... lambda_facts Gathers AWS Lambda fun... lambda_policy Creates, updates or de... layman Manage Gentoo overlays ldap_attr Add or remove LDAP att... ldap_entry Add or remove LDAP ent... ldap_passwd Set passwords in LDAP. librato_annotation create an annotation i... lightsail Create or delete a vir... lineinfile Manage lines in text f... linode Manage instances on th... lldp get details reported b... locale_gen Creates or removes loc... logentries Module for tracking lo... logentries_msg Send a message to loge... logicmonitor Manage your LogicMonit... logicmonitor_facts Collect facts about Lo... logstash_plugin Manage Logstash plugin... lvg Configure LVM volume g... lvol Configure LVM logical ... lxc_container Manage LXC Containers lxd_container Manage LXD Containers lxd_profile Manage LXD profiles macports Package manager for Ma... mail Send an email make Run targets in a Makef... manageiq_alert_profiles Configuration of alert... manageiq_alerts Configuration of alert... manageiq_policies Management of resource... manageiq_provider Management of provider... manageiq_tags Management of resource... manageiq_user Management of users in... mattermost Send Mattermost notifi... maven_artifact Downloads an Artifact ... memset_dns_reload Request reload of Mems... memset_zone Creates and deletes Me... memset_zone_domain Create and delete doma... memset_zone_record Create and delete reco... meraki_admin Manage administrators ... meraki_network Manage networks in the... meraki_organization Manage organizations i... meraki_snmp Manage organizations i... meta Execute Ansible 'actio... mksysb Generates AIX mksysb r... modprobe Load or unload kernel ... mongodb_parameter Change an administrati... mongodb_user Adds or removes a user... monit Manage the state of a ... mount Control active and con... mqtt Publish a message on a... mssql_db Add or remove MSSQL da... mysql_db Add or remove MySQL da... mysql_replication Manage MySQL replicati... mysql_user Adds or removes a user... mysql_variables Manage MySQL global va... na_cdot_aggregate Manage NetApp cDOT agg... na_cdot_license Manage NetApp cDOT pro... na_cdot_lun Manage NetApp cDOT lu... na_cdot_qtree Manage qtrees na_cdot_svm Manage NetApp cDOT svm na_cdot_user useradmin configuratio... na_cdot_user_role useradmin configuratio... na_cdot_volume Manage NetApp cDOT vol... na_ontap_aggregate Manage NetApp ONTAP ag... na_ontap_broadcast_domain Manage NetApp ONTAP br... na_ontap_broadcast_domain_ports Manage NetApp Ontap br... na_ontap_cifs Manage NetApp cifs-sha... na_ontap_cifs_acl Manage NetApp cifs-sha... na_ontap_cifs_server cifs server configurat... na_ontap_cluster Create/Join ONTAP clus... na_ontap_cluster_ha Manage HA status for c... na_ontap_export_policy Manage NetApp ONTAP ex... na_ontap_export_policy_rule Manage ONTAP Export ru... na_ontap_igroup ONTAP iSCSI igroup con... na_ontap_interface ONTAP LIF configuratio... na_ontap_iscsi Manage NetApp Ontap is... na_ontap_job_schedule Manage NetApp Ontap Jo... na_ontap_license Manage NetApp ONTAP pr... na_ontap_lun Manage NetApp Ontap l... na_ontap_lun_map Manage NetApp Ontap lu... na_ontap_net_ifgrp Create, modify, destro... na_ontap_net_port Manage NetApp Ontap ne... na_ontap_net_routes Manage NetApp Ontap ne... na_ontap_net_vlan Manage NetApp Ontap ne... na_ontap_nfs Manage Ontap NFS statu... na_ontap_ntp Create/Delete/modify_v... na_ontap_qtree Manage qtrees na_ontap_service_processor_network Manage NetApp Ontap se... na_ontap_snapshot Manage NetApp Sanpshot... na_ontap_snmp Manage NetApp SNMP com... na_ontap_svm Manage NetApp Ontap sv... na_ontap_ucadapter ONTAP UC adapter confi... na_ontap_user useradmin configuratio... na_ontap_user_role useradmin configuratio... na_ontap_volume Manage NetApp ONTAP vo... na_ontap_volume_clone Manage NetApp Ontap vo... nagios Perform common tasks i... nclu Configure network inte... net_banner Manage multiline banne... net_get Copy a file from a net... net_interface Manage Interface on ne... net_l2_interface Manage Layer-2 interfa... net_l3_interface Manage L3 interfaces o... net_linkagg Manage link aggregatio... net_lldp Manage LLDP service co... net_lldp_interface Manage LLDP interfaces... net_logging Manage logging on netw... net_ping Tests reachability usi... net_put Copy a file from Ansib... net_static_route Manage static IP route... net_system Manage the system attr... net_user Manage the aggregate o... net_vlan Manage VLANs on networ... net_vrf Manage VRFs on network... netact_cm_command Manage network configu... netapp_e_amg Create, Remove, and Up... netapp_e_amg_role Update the role of a s... netapp_e_amg_sync Conduct synchronizatio... netapp_e_auth Sets or updates the pa... netapp_e_facts Get facts about NetApp... netapp_e_flashcache Manage NetApp SSD cach... netapp_e_host manage eseries hosts netapp_e_hostgroup Manage NetApp Storage ... netapp_e_lun_mapping Create or Remove LUN M... netapp_e_snapshot_group Manage snapshot groups netapp_e_snapshot_images Create and delete snap... netapp_e_snapshot_volume Manage E/EF-Series sna... netapp_e_storage_system Add/remove arrays from... netapp_e_storagepool Manage disk groups and... netapp_e_volume Manage storage volumes... netapp_e_volume_copy Create volume copy pai... netconf_config netconf device configu... netconf_get Fetch configuration/st... netconf_rpc Execute operations on ... netscaler Manages Citrix NetScal... netscaler_cs_action Manage content switchi... netscaler_cs_policy Manage content switchi... netscaler_cs_vserver Manage content switchi... netscaler_gslb_service Manage gslb service en... netscaler_gslb_site Manage gslb site entit... netscaler_gslb_vserver Configure gslb vserver... netscaler_lb_monitor Manage load balancing ... netscaler_lb_vserver Manage load balancing ... netscaler_nitro_request Issue Nitro API reques... netscaler_save_config Save Netscaler configu... netscaler_server Manage server configur... netscaler_service Manage service configu... netscaler_servicegroup Manage service group c... netscaler_ssl_certkey Manage ssl cerificate ... newrelic_deployment Notify newrelic about ... nexmo Send a SMS via nexmo nginx_status_facts Retrieve nginx status ... nios_dns_view Configure Infoblox NIO... nios_host_record Configure Infoblox NIO... nios_network Configure Infoblox NIO... nios_network_view Configure Infoblox NIO... nios_zone Configure Infoblox NIO... nmcli Manage Networking nosh Manage services with n... npm Manage node.js package... nso_action Executes Cisco NSO act... nso_config Manage Cisco NSO confi... nso_query Query data from Cisco ... nso_show Displays data from Cis... nso_verify Verifies Cisco NSO con... nsupdate Manage DNS records. nuage_vspk Manage Nuage VSP envir... nxos_aaa_server Manages AAA server glo... nxos_aaa_server_host Manages AAA server hos... nxos_acl Manages access list en... nxos_acl_interface Manages applying ACLs ... nxos_banner Manage multiline banne... nxos_bgp Manages BGP configurat... nxos_bgp_af Manages BGP Address-fa... nxos_bgp_neighbor Manages BGP neighbors ... nxos_bgp_neighbor_af Manages BGP address-fa... nxos_command Run arbitrary command ... nxos_config Manage Cisco NXOS conf... nxos_evpn_global Handles the EVPN contr... nxos_evpn_vni Manages Cisco EVPN VXL... nxos_facts Gets facts about NX-OS... nxos_feature Manage features in NX-... nxos_file_copy Copy a file to a remot... nxos_gir Trigger a graceful rem... nxos_gir_profile_management Create a maintenance-m... nxos_hsrp Manages HSRP configura... nxos_igmp Manages IGMP global co... nxos_igmp_interface Manages IGMP interface... nxos_igmp_snooping Manages IGMP snooping ... nxos_install_os Set boot options like ... nxos_interface Manages physical attri... nxos_interface_ospf Manages configuration ... nxos_ip_interface Manages L3 attributes ... nxos_l2_interface Manage Layer-2 interfa... nxos_l3_interface Manage L3 interfaces o... nxos_linkagg Manage link aggregatio... nxos_lldp Manage LLDP configurat... nxos_logging Manage logging on netw... nxos_mtu Manages MTU settings o... nxos_ntp Manages core NTP confi... nxos_ntp_auth Manages NTP authentica... nxos_ntp_options Manages NTP options. nxos_nxapi Manage NXAPI configura... nxos_ospf Manages configuration ... nxos_ospf_vrf Manages a VRF for an O... nxos_overlay_global Configures anycast gat... nxos_pim Manages configuration ... nxos_pim_interface Manages PIM interface ... nxos_pim_rp_address Manages configuration ... nxos_ping Tests reachability usi... nxos_portchannel Manages port-channel i... nxos_reboot Reboot a network devic... nxos_rollback Set a checkpoint or ro... nxos_smu Perform SMUs on Cisco ... nxos_snapshot Manage snapshots of th... nxos_snmp_community Manages SNMP community... nxos_snmp_contact Manages SNMP contact i... nxos_snmp_host Manages SNMP host conf... nxos_snmp_location Manages SNMP location ... nxos_snmp_traps Manages SNMP traps. nxos_snmp_user Manages SNMP users for... nxos_static_route Manages static route c... nxos_switchport Manages Layer 2 switch... nxos_system Manage the system attr... nxos_udld Manages UDLD global co... nxos_udld_interface Manages UDLD interface... nxos_user Manage the collection ... nxos_vlan Manages VLAN resources... nxos_vpc Manages global VPC con... nxos_vpc_interface Manages interface VPC ... nxos_vrf Manages global VRF con... nxos_vrf_af Manages VRF AF. nxos_vrf_interface Manages interface spec... nxos_vrrp Manages VRRP configura... nxos_vtp_domain Manages VTP domain con... nxos_vtp_password Manages VTP password c... nxos_vtp_version Manages VTP version co... nxos_vxlan_vtep Manages VXLAN Network ... nxos_vxlan_vtep_vni Creates a Virtual Netw... oc Manage OpenShift Resou... office_365_connector_card Use webhooks to create... ohai Returns inventory data... omapi_host Setup OMAPI hosts. one_host Manages OpenNebula Hos... one_image Manages OpenNebula ima... one_image_facts Gather facts about Ope... one_service Deploy and manage Open... one_vm Creates or terminates ... oneandone_firewall_policy Configure 1&1 firewall... oneandone_load_balancer Configure 1&1 load bal... oneandone_monitoring_policy Configure 1&1 monitori... oneandone_private_network Configure 1&1 private ... oneandone_public_ip Configure 1&1 public I... oneandone_server Create, destroy, start... oneview_datacenter_facts Retrieve facts about t... oneview_enclosure_facts Retrieve facts about o... oneview_ethernet_network Manage OneView Etherne... oneview_ethernet_network_facts Retrieve the facts abo... oneview_fc_network Manage OneView Fibre C... oneview_fc_network_facts Retrieve the facts abo... oneview_fcoe_network Manage OneView FCoE Ne... oneview_fcoe_network_facts Retrieve the facts abo... oneview_logical_interconnect_group Manage OneView Logical... oneview_logical_interconnect_group_facts Retrieve facts about o... oneview_network_set Manage HPE OneView Net... oneview_network_set_facts Retrieve facts about t... oneview_san_manager Manage OneView SAN Man... oneview_san_manager_facts Retrieve facts about o... onyx_bgp Configures BGP on Mell... onyx_command Run commands on remote... onyx_config Manage Mellanox ONYX c... onyx_facts Collect facts from Mel... onyx_interface Manage Interfaces on M... onyx_l2_interface Manage Layer-2 interfa... onyx_l3_interface Manage L3 interfaces o... onyx_linkagg Manage link aggregatio... onyx_lldp Manage LLDP configurat... onyx_lldp_interface Manage LLDP interfaces... onyx_magp Manage MAGP protocol o... onyx_mlag_ipl Manage IPL (inter-peer... onyx_mlag_vip Configures MLAG VIP on... onyx_ospf Manage OSPF protocol o... onyx_pfc_interface Manage priority flow c... onyx_protocol Enables/Disables proto... onyx_vlan Manage VLANs on Mellan... open_iscsi Manage iscsi targets w... openbsd_pkg Manage packages on Ope... opendj_backendprop Will update the backen... openshift_raw Manage Kubernetes (K8s... openshift_scale Set a new size for a D... openssl_certificate Generate and/or check ... openssl_csr Generate OpenSSL Certi... openssl_dhparam Generate OpenSSL Diffi... openssl_privatekey Generate OpenSSL priva... openssl_publickey Generate an OpenSSL pu... openvswitch_bridge Manage Open vSwitch br... openvswitch_db Configure open vswitch... openvswitch_port Manage Open vSwitch po... openwrt_init Manage services on Ope... opkg Package manager for Op... ordnance_config Manage Ordnance config... ordnance_facts Collect facts from Ord... os_auth Retrieve an auth token os_client_config Get OpenStack Client c... os_flavor_facts Retrieve facts about o... os_floating_ip Add/Remove floating IP... os_group Manage OpenStack Ident... os_image Add/Delete images from... os_image_facts Retrieve facts about a... os_ironic Create/Delete Bare Met... os_ironic_inspect Explicitly triggers ba... os_ironic_node Activate/Deactivate Ba... os_keypair Add/Delete a keypair f... os_keystone_domain Manage OpenStack Ident... os_keystone_domain_facts Retrieve facts about o... os_keystone_endpoint Manage OpenStack Ident... os_keystone_role Manage OpenStack Ident... os_keystone_service Manage OpenStack Ident... os_network Creates/removes networ... os_networks_facts Retrieve facts about o... os_nova_flavor Manage OpenStack compu... os_nova_host_aggregate Manage OpenStack host ... os_object Create or Delete objec... os_port Add/Update/Delete port... os_port_facts Retrieve facts about p... os_project Manage OpenStack Proje... os_project_access Manage OpenStack compu... os_project_facts Retrieve facts about o... os_quota Manage OpenStack Quota... os_recordset Manage OpenStack DNS r... os_router Create or delete route... os_security_group Add/Delete security gr... os_security_group_rule Add/Delete rule from a... os_server Create/Delete Compute ... os_server_action Perform actions on Com... os_server_facts Retrieve facts about o... os_server_group Manage OpenStack serve... os_server_metadata Add/Update/Delete Meta... os_server_volume Attach/Detach Volumes ... os_stack Add/Remove Heat Stack os_subnet Add/Remove subnet to a... os_subnets_facts Retrieve facts about o... os_user Manage OpenStack Ident... os_user_facts Retrieve facts about o... os_user_group Associate OpenStack Id... os_user_role Associate OpenStack Id... os_volume Create/Delete Cinder V... os_volume_snapshot Create/Delete Cinder V... os_zone Manage OpenStack DNS z... osx_defaults osx_defaults allows us... ovh_ip_loadbalancing_backend Manage OVH IP LoadBala... ovirt oVirt/RHEV platform ma... ovirt_affinity_group Module to manage affin... ovirt_affinity_label Module to manage affin... ovirt_affinity_label_facts Retrieve facts about o... ovirt_api_facts Retrieve facts about t... ovirt_auth Module to manage authe... ovirt_cluster Module to manage clust... ovirt_cluster_facts Retrieve facts about o... ovirt_datacenter Module to manage data ... ovirt_datacenter_facts Retrieve facts about o... ovirt_disk Module to manage Virtu... ovirt_disk_facts Retrieve facts about o... ovirt_external_provider Module to manage exter... ovirt_external_provider_facts Retrieve facts about o... ovirt_group Module to manage group... ovirt_group_facts Retrieve facts about o... ovirt_host_networks Module to manage host ... ovirt_host_pm Module to manage power... ovirt_host_storage_facts Retrieve facts about o... ovirt_hosts Module to manage hosts... ovirt_hosts_facts Retrieve facts about o... ovirt_mac_pools Module to manage MAC p... ovirt_networks Module to manage logic... ovirt_networks_facts Retrieve facts about o... ovirt_nics Module to manage netwo... ovirt_nics_facts Retrieve facts about o... ovirt_permissions Module to manage permi... ovirt_permissions_facts Retrieve facts about o... ovirt_quotas Module to manage datac... ovirt_quotas_facts Retrieve facts about o... ovirt_scheduling_policies_facts Retrieve facts about o... ovirt_snapshots Module to manage Virtu... ovirt_snapshots_facts Retrieve facts about o... ovirt_storage_connections Module to manage stora... ovirt_storage_domains Module to manage stora... ovirt_storage_domains_facts Retrieve facts about o... ovirt_storage_templates_facts Retrieve facts about o... ovirt_storage_vms_facts Retrieve facts about o... ovirt_tags Module to manage tags ... ovirt_tags_facts Retrieve facts about o... ovirt_templates Module to manage virtu... ovirt_templates_facts Retrieve facts about o... ovirt_users Module to manage users... ovirt_users_facts Retrieve facts about o... ovirt_vmpools Module to manage VM po... ovirt_vmpools_facts Retrieve facts about o... ovirt_vms Module to manage Virtu... ovirt_vms_facts Retrieve facts about o... pacemaker_cluster Manage pacemaker clust... package Generic OS package man... package_facts package information as... packet_device Manage a bare metal se... packet_sshkey Create/delete an SSH k... pacman Manage packages with `... pagerduty Create PagerDuty maint... pagerduty_alert Trigger, acknowledge o... pam_limits Modify Linux PAM limit... pamd Manage PAM Modules panos_admin Add or modify PAN-OS u... panos_admpwd change admin password ... panos_cert_gen_ssh generates a self-signe... panos_check check if PAN-OS device... panos_commit commit firewall's cand... panos_dag create a dynamic addre... panos_dag_tags Create tags for DAG's ... panos_import import file on PAN-OS ... panos_interface configure data-port ne... panos_lic apply authcode to a de... panos_loadcfg load configuration on ... panos_match_rule Test for match against... panos_mgtconfig configure management s... panos_nat_policy create a policy NAT ru... panos_nat_rule create a policy NAT ru... panos_object create/read/update/del... panos_op execute arbitrary OP c... panos_pg create a security prof... panos_query_rules PANOS module that allo... panos_restart restart a device panos_sag Create a static addres... panos_security_policy Create security rule p... panos_security_rule Create security rule p... parted Configure block device... patch Apply patch files usin... pause Pause playbook executi... pear Manage pear/pecl packa... ping Try to connect to host... pingdom Pause/unpause Pingdom ... pip Manages Python library... pkg5 Manages packages with ... pkg5_publisher Manages Solaris 11 Ima... pkgin Package manager for Sm... pkgng Package manager for Fr... pkgutil Manage CSW-Packages on... pn_cluster CLI command to create/... pn_ospf CLI command to add/rem... pn_ospfarea CLI command to add/rem... pn_show Run show commands on n... pn_trunk CLI command to create/... pn_vlag CLI command to create/... pn_vlan CLI command to create/... pn_vrouter CLI command to create/... pn_vrouterbgp CLI command to add/rem... pn_vrouterif CLI command to add/rem... pn_vrouterlbif CLI command to add/rem... portage Package manager for Ge... portinstall Installing packages fr... postgresql_db Add or remove PostgreS... postgresql_ext Add or remove PostgreS... postgresql_lang Adds, removes or chang... postgresql_privs Grant or revoke privil... postgresql_schema Add or remove PostgreS... postgresql_user Adds or removes a user... profitbricks Create, destroy, start... profitbricks_datacenter Create or destroy a Pr... profitbricks_nic Create or Remove a NIC... profitbricks_volume Create or destroy a vo... profitbricks_volume_attachments Attach or detach a vol... proxmox management of instance... proxmox_kvm Management of Qemu(KVM... proxmox_template management of OS templ... proxysql_backend_servers Adds or removes mysql ... proxysql_global_variables Gets or sets the proxy... proxysql_manage_config Writes the proxysql co... proxysql_mysql_users Adds or removes mysql ... proxysql_query_rules Modifies query rules u... proxysql_replication_hostgroups Manages replication ho... proxysql_scheduler Adds or removes schedu... psexec Runs commands on a rem... pubnub_blocks PubNub blocks manageme... pulp_repo Add or remove Pulp rep... puppet Runs puppet purefa_ds Configure FlashArray D... purefa_facts Collect facts from Pur... purefa_hg Manage hostgroups on P... purefa_host Manage hosts on Pure S... purefa_pg Manage protection grou... purefa_pgsnap Manage protection grou... purefa_snap Manage volume snapshot... purefa_volume Manage volumes on Pure... purefb_fs Manage filesystemon Pu... purefb_snap Manage filesystem snap... pushbullet Sends notifications to... pushover Send notifications via... rabbitmq_binding This module manages ra... rabbitmq_exchange This module manages ra... rabbitmq_parameter Adds or removes parame... rabbitmq_plugin Manage RabbitMQ plugin... rabbitmq_policy Manage the state of po... rabbitmq_queue This module manages ra... rabbitmq_user Adds or removes users ... rabbitmq_vhost Manage the state of a ... raw Executes a low-down an... rax create / delete an ins... rax_cbs Manipulate Rackspace C... rax_cbs_attachments Manipulate Rackspace C... rax_cdb create/delete or resiz... rax_cdb_database create / delete a data... rax_cdb_user create / delete a Rack... rax_clb create / delete a load... rax_clb_nodes add, modify and remove... rax_clb_ssl Manage SSL termination... rax_dns Manage domains on Rack... rax_dns_record Manage DNS records on ... rax_facts Gather facts for Racks... rax_files Manipulate Rackspace C... rax_files_objects Upload, download, and ... rax_identity Load Rackspace Cloud I... rax_keypair Create a keypair for u... rax_meta Manipulate metadata fo... rax_mon_alarm Create or delete a Rac... rax_mon_check Create or delete a Rac... rax_mon_entity Create or delete a Rac... rax_mon_notification Create or delete a Rac... rax_mon_notification_plan Create or delete a Rac... rax_network create / delete an iso... rax_queue create / delete a queu... rax_scaling_group Manipulate Rackspace C... rax_scaling_policy Manipulate Rackspace C... rds create, delete, or mod... rds_instance_facts obtain facts about one... rds_param_group manage RDS parameter g... rds_snapshot_facts obtain facts about one... rds_subnet_group manage RDS database su... redhat_subscription Manage registration an... redis Various redis commands... redshift create, delete, or mod... redshift_facts Gather facts about Red... redshift_subnet_group manage Redshift cluste... replace Replace all instances ... rhevm RHEV/oVirt automation rhn_channel Adds or removes Red Ha... rhn_register Manage Red Hat Network... rhsm_repository Manage RHSM repositori... riak This module handles so... rocketchat Send notifications to ... rollbar_deployment Notify Rollbar about a... route53 add or delete entries ... route53_facts Retrieves route53 deta... route53_health_check add or delete health-c... route53_zone add or delete Route53 ... rpm_key Adds or removes a gpg ... rundeck_acl_policy Manage Rundeck ACL pol... rundeck_project Manage Rundeck project... runit Manage runit services s3_bucket Manage S3 buckets in A... s3_lifecycle Manage s3 bucket lifec... s3_logging Manage logging facilit... s3_sync Efficiently upload mul... s3_website Configure an s3 bucket... say Makes a computer to sp... scaleway_compute Scaleway compute manag... scaleway_sshkey Scaleway SSH keys mana... script Runs a local script on... seboolean Toggles SELinux boolea... sefcontext Manages SELinux file c... selinux Change policy and stat... selinux_permissive Change permissive doma... sendgrid Sends an email with th... sensu_check Manage Sensu checks sensu_client Manages Sensu client c... sensu_handler Manages Sensu handler ... sensu_silence Manage Sensu silence e... sensu_subscription Manage Sensu subscript... seport Manages SELinux networ... serverless Manages a Serverless F... service Manage services service_facts Return service state i... set_fact Set host facts from a ... set_stats Set stats for the curr... setup Gathers facts about re... sf_account_manager Manage SolidFire accou... sf_check_connections Check connectivity to ... sf_snapshot_schedule_manager Manage SolidFire snaps... sf_volume_access_group_manager Manage SolidFire Volum... sf_volume_manager Manage SolidFire volum... shell Execute commands in no... sl_vm create or cancel a vir... slack Send Slack notificatio... slackpkg Package manager for Sl... slurp Slurps a file from rem... slxos_command Run commands on remote... slxos_config Manage Extreme Network... slxos_facts Collect facts from dev... slxos_interface Manage Interfaces on E... slxos_l2_interface Manage Layer-2 interfa... slxos_l3_interface Manage L3 interfaces o... slxos_linkagg Manage link aggregatio... slxos_vlan Manage VLANs on Extrem... smartos_image_facts Get SmartOS image deta... snmp_facts Retrieve facts for a d... snow_record Create/Delete/Update r... sns Send Amazon Simple Not... sns_topic Manages AWS SNS topics... solaris_zone Manage Solaris zones sorcery Package manager for So... spectrum_device Creates/deletes device... spotinst_aws_elastigroup Create, update or dele... sqs_queue Creates or deletes AWS... sros_command Run commands on remote... sros_config Manage Nokia SR OS dev... sros_rollback Configure Nokia SR OS ... stackdriver Send code deploy and a... stacki_host Add or remove host to ... stat Retrieve file or file ... statusio_maintenance Create maintenance win... sts_assume_role Assume a role using AW... sts_session_token Obtain a session token... subversion Deploys a subversion r... supervisorctl Manage the state of a ... svc Manage daemontools ser... svr4pkg Manage Solaris SVR4 pa... swdepot Manage packages with s... swupd Manages updates and bu... synchronize A wrapper around rsync... sysctl Manage entries in sysc... syslogger Log messages in the sy... systemd Manage services sysvinit Manage SysV services. taiga_issue Creates/deletes an iss... telegram module for sending not... telnet Executes a low-down an... tempfile Creates temporary file... template Templates a file out t... terraform Manages a Terraform de... timezone Configure timezone set... tower_credential create, update, or des... tower_group create, update, or des... tower_host create, update, or des... tower_inventory create, update, or des... tower_job_cancel Cancel an Ansible Towe... tower_job_launch Launch an Ansible Job. tower_job_list List Ansible Tower job... tower_job_template create, update, or des... tower_job_wait Wait for Ansible Tower... tower_label create, update, or des... tower_organization create, update, or des... tower_project create, update, or des... tower_role create, update, or des... tower_team create, update, or des... tower_user create, update, or des... twilio Sends a text message t... typetalk Send a message to type... ucs_ip_pool Configures IP address ... ucs_lan_connectivity Configures LAN Connect... ucs_mac_pool Configures MAC address... ucs_san_connectivity Configures SAN Connect... ucs_vhba_template Configures vHBA templa... ucs_vlans Configures VLANs on Ci... ucs_vnic_template Configures vNIC templa... ucs_vsans Configures VSANs on Ci... ucs_wwn_pool Configures WWNN or WWP... udm_dns_record Manage dns entries on ... udm_dns_zone Manage dns zones on a ... udm_group Manage of the posix gr... udm_share Manage samba shares on... udm_user Manage posix users on ... ufw Manage firewall with U... unarchive Unpacks an archive aft... uptimerobot Pause and start Uptime... uri Interacts with webserv... urpmi Urpmi manager user Manage user accounts vca_fw add remove firewall ru... vca_nat add remove nat rules i... vca_vapp Manages vCloud Air vAp... vcenter_folder Manage folders on give... vcenter_license Manage VMware vCenter ... vdirect_commit Commits pending config... vdirect_file Uploads a new or updat... vdirect_runnable Runs templates and wor... vdo Module to control VDO vertica_configuration Updates Vertica config... vertica_facts Gathers Vertica databa... vertica_role Adds or removes Vertic... vertica_schema Adds or removes Vertic... vertica_user Adds or removes Vertic... virt Manages virtual machin... virt_net Manage libvirt network... virt_pool Manage libvirt storage... vmadm Manage SmartOS virtual... vmware_cfg_backup Backup / Restore / Res... vmware_cluster Manage VMware vSphere ... vmware_cluster_facts Gather facts about clu... vmware_datacenter Manage VMware vSphere ... vmware_datastore_cluster Manage VMware vSphere ... vmware_datastore_facts Gather facts about dat... vmware_datastore_maintenancemode Place a datastore into... vmware_dns_config Manage VMware ESXi DNS... vmware_drs_rule_facts Gathers facts about DR... vmware_dvs_host Add or remove a host f... vmware_dvs_portgroup Create or remove a Dis... vmware_dvswitch Create or remove a dis... vmware_guest Manages virtual machin... vmware_guest_disk_facts Gather facts about dis... vmware_guest_facts Gather facts about a s... vmware_guest_file_operation Files operation in a V... vmware_guest_find Find the folder path(s... vmware_guest_powerstate Manages power states o... vmware_guest_snapshot Manages virtual machin... vmware_guest_snapshot_facts Gather facts about vir... vmware_guest_tools_wait Wait for VMware tools ... vmware_host Add / Remove ESXi host... vmware_host_acceptance Manage acceptance leve... vmware_host_capability_facts Gathers facts about an... vmware_host_config_facts Gathers facts about an... vmware_host_config_manager Manage advance configu... vmware_host_datastore Manage a datastore on ... vmware_host_dns_facts Gathers facts about an... vmware_host_facts Gathers facts about re... vmware_host_firewall_facts Gathers facts about an... vmware_host_firewall_manager Manage firewall config... vmware_host_lockdown Manage administrator p... vmware_host_ntp Manage NTP configurati... vmware_host_package_facts Gathers facts about av... vmware_host_powerstate Manages power states o... vmware_host_service_facts Gathers facts about an... vmware_host_service_manager Manage services on a g... vmware_host_vmnic_facts Gathers facts about vm... vmware_local_role_manager Manage local roles on ... vmware_local_user_facts Gather facts about use... vmware_local_user_manager Manage local users on ... vmware_maintenancemode Place a host into main... vmware_migrate_vmk Migrate a VMK interfac... vmware_portgroup Create a VMware portgr... vmware_portgroup_facts Gathers facts about an... vmware_resource_pool Add/remove resource po... vmware_resource_pool_facts Gathers facts about re... vmware_tag Manage VMware tags vmware_tag_facts Manage VMware tag fact... vmware_target_canonical_facts Return canonical (NAA)... vmware_vm_facts Return basic facts per... vmware_vm_shell Run commands in a VMwa... vmware_vm_vm_drs_rule Configure VMware DRS A... vmware_vm_vss_dvs_migrate Migrates a virtual mac... vmware_vmkernel Manage a VMware VMkern... vmware_vmkernel_facts Gathers VMKernel facts... vmware_vmkernel_ip_config Configure the VMkernel... vmware_vmotion Move a virtual machine... vmware_vsan_cluster Configure VSAN cluster... vmware_vswitch Manage a VMware Standa... vmware_vswitch_facts Gathers facts about an... vr_account_facts Gather facts about the... vr_dns_domain Manages DNS domains on... vr_dns_record Manages DNS records on... vr_firewall_group Manages firewall group... vr_firewall_rule Manages firewall rules... vr_server Manages virtual server... vr_ssh_key Manages ssh keys on Vu... vr_startup_script Manages startup script... vr_user Manages users on Vultr... vsphere_copy Copy a file to a vCent... vsphere_guest Create/delete/manage a... vyos_banner Manage multiline banne... vyos_command Run one or more comman... vyos_config Manage VyOS configurat... vyos_facts Collect facts from rem... vyos_interface Manage Interface on Vy... vyos_l3_interface Manage L3 interfaces o... vyos_linkagg Manage link aggregatio... vyos_lldp Manage LLDP configurat... vyos_lldp_interface Manage LLDP interfaces... vyos_logging Manage logging on netw... vyos_static_route Manage static IP route... vyos_system Run `set system` comma... vyos_user Manage the collection ... vyos_vlan Manage VLANs on VyOS n... wait_for Waits for a condition ... wait_for_connection Waits until remote sys... wakeonlan Send a magic Wake-on-L... webfaction_app Add or remove applicat... webfaction_db Add or remove a databa... webfaction_domain Add or remove domains ... webfaction_mailbox Add or remove mailboxe... webfaction_site Add or remove a websit... win_acl Set file/directory/reg... win_acl_inheritance Change ACL inheritance win_audit_policy_system Used to make changes t... win_audit_rule Adds an audit rule to ... win_certificate_store Manages the certificat... win_chocolatey Manage packages using ... win_command Executes a command on ... win_copy Copies files to remote... win_defrag Consolidate fragmented... win_disk_facts Show the attached disk... win_disk_image Manage ISO/VHD/VHDX mo... win_dns_client Configures DNS lookup ... win_domain Ensures the existence ... win_domain_computer Manage computers in Ac... win_domain_controller Manage domain controll... win_domain_group Creates, modifies or r... win_domain_membership Manage domain/workgrou... win_domain_user Manages Windows Active... win_dotnet_ngen Runs ngen to recompile... win_dsc Invokes a PowerShell D... win_environment Modify environment var... win_eventlog Manage Windows event l... win_eventlog_entry Write entries to Windo... win_feature Installs and uninstall... win_file Creates, touches or re... win_file_version Get DLL or EXE file bu... win_find Return a list of files... win_firewall Enable or disable the ... win_firewall_rule Windows firewall autom... win_get_url Downloads file from HT... win_group Add and remove local g... win_group_membership Manage Windows local g... win_hostname Manages local Windows ... win_hotfix Install and uninstalls... win_iis_virtualdirectory Configures a virtual d... win_iis_webapplication Configures IIS web app... win_iis_webapppool Configure IIS Web Appl... win_iis_webbinding Configures a IIS Web s... win_iis_website Configures a IIS Web s... win_lineinfile Ensure a particular li... win_mapped_drive Map network drives for... win_msg Sends a message to log... win_msi Installs and uninstall... win_nssm NSSM - the Non-Sucking... win_owner Set owner win_package Installs/uninstalls an... win_pagefile Query or change pagefi... win_path Manage Windows path en... win_pester Run Pester tests on Wi... win_ping A windows version of t... win_power_plan Changes the power plan... win_product_facts Provides Windows produ... win_psexec Runs commands (remotel... win_psmodule Adds or removes a Powe... win_rabbitmq_plugin Manage RabbitMQ plugin... win_reboot Reboot a windows machi... win_reg_stat Get information about ... win_regedit Add, change, or remove... win_region Set the region and for... win_regmerge Merges the contents of... win_robocopy Synchronizes the conte... win_route Add or remove a static... win_say Text to speech module ... win_scheduled_task Manage scheduled tasks win_scheduled_task_stat Get information about ... win_security_policy Change local security ... win_service Manage and query Windo... win_share Manage Windows shares win_shell Execute shell commands... win_shortcut Manage shortcuts on Wi... win_stat Get information about ... win_tempfile Creates temporary file... win_template Templates a file out t... win_timezone Sets Windows machine t... win_toast Sends Toast windows no... win_unzip Unzips compressed file... win_updates Download and install W... win_uri Interacts with webserv... win_user Manages local Windows ... win_user_right Manage Windows User Ri... win_wait_for Waits for a condition ... win_wakeonlan Send a magic Wake-on-L... win_webpicmd Installs packages usin... win_whoami Get information about ... xattr Manage user defined ex... xbps Manage packages with X... xenserver_facts get facts reported on ... xml Manage bits and pieces... yarn Manage node.js package... yum Manages packages with ... yum_repository Add or remove YUM repo... zabbix_group Zabbix host groups cre... zabbix_group_facts Gather facts about Zab... zabbix_host Zabbix host creates/up... zabbix_hostmacro Zabbix host macro crea... zabbix_maintenance Create Zabbix maintena... zabbix_proxy Zabbix proxy creates/d... zabbix_screen Zabbix screen creates/... zabbix_template create/delete/dump zab... zfs Manage zfs zfs_facts Gather facts about ZFS... znode Create, delete, retrie... zpool_facts Gather facts about ZFS... zypper Manage packages on SUS... zypper_repository Add and remove Zypper ...

    Modules Documentation

    Returns a thorough description of the parameters in the module.

    [ansible@redhat] $ ansible-doc copy 
    
    > COPY (/usr/lib/python2.7/site-packages/ansible/modules/files/copy.py) The `copy' module copies a file from the local or remote machine to a location on the remote machine. Use the [fetch] module to copy files from remote locations to the local box. If you need variable interpolation in copied files, use the [template] module. For Windows targets, use the [win_copy] module instead. * note: This module has a corresponding action plugin. OPTIONS (= is mandatory): - attributes Attributes the file or directory should have. To get supported flags look at the man page for `chattr' on the target system. This string should contain the attributes in the same order as the one displayed by `lsattr'. (Aliases: attr)[Default: (null)] version_added: 2.3 - backup Create a backup file including the timestamp information so you can get the original file back if you somehow clobbered it incorrectly. [Default: no] type: bool version_added: 0.7 - checksum SHA1 checksum of the file being transferred. Used to validate that the copy of the file was successful. If this is not provided, ansible will use the local calculated checksum of the src file. [Default: (null)] version_added: 2.5 - content When used instead of `src', sets the contents of a file directly to the specified value. For anything advanced or with formatting also look at the template module. [Default: (null)] version_added: 1.1 - decrypt This option controls the autodecryption of source files using vault. [Default: Yes] type: bool version_added: 2.4 = dest Remote absolute path where the file should be copied to. If `src' is a directory, this must be a directory too. If `dest' is a nonexistent path and if either `dest' ends with "/" or `src' is a directory, `dest' is created. If `src' and `dest' are files, the parent directory of `dest' isn't created: the task fails if it doesn't already exist. - directory_mode When doing a recursive copy set the mode for the directories. If this is not set we will use the system defaults. The mode is only set on directories which are newly created, and will not affect those that already existed. [Default: (null)] version_added: 1.5 - follow This flag indicates that filesystem links in the destination, if they exist, should be followed. [Default: no] type: bool version_added: 1.8 - force the default is `yes', which will replace the remote file when contents are different than the source. If `no', the file will only be transferred if the destination does not exist. (Aliases: thirsty)[Default: yes] type: bool version_added: 1.1 - group Name of the group that should own the file/directory, as would be fed to `chown'. [Default: (null)] - local_follow This flag indicates that filesystem links in the source tree, if they exist, should be followed. [Default: yes] type: bool version_added: 2.4 - mode Mode the file or directory should be. For those used to `/usr/bin/chmod' remember that modes are actually octal numbers. You must either specify the leading zero so that Ansible's YAML parser knows it is an octal number (like `0644' or `01777') or quote it (like `'644'' or `'0644'' so Ansible receives a string and can do its own conversion from string into number. Giving Ansible a number without following one of these rules will end up with a decimal number which will have unexpected results. As of version 1.8, the mode may be specified as a symbolic mode (for example, `u+rwx' or `u=rw,g=r,o=r'). As of version 2.3, the mode may also be the special string `preserve'. `preserve' means that the file will be given the same permissions as the source file. [Default: (null)] - owner Name of the user that should own the file/directory, as would be fed to `chown'. [Default: (null)] - remote_src If `no', it will search for `src' at originating/master machine. If `yes' it will go to the remote/target machine for the `src'. Default is `no'. Currently `remote_src' does not support recursive copying. `remote_src' only works with `mode=preserve' as of version 2.6. [Default: no] type: bool version_added: 2.0 - selevel Level part of the SELinux file context. This is the MLS/MCS attribute, sometimes known as the `range'. `_default' feature works as for `seuser'. [Default: s0] - serole Role part of SELinux file context, `_default' feature works as for `seuser'. [Default: (null)] - setype Type part of SELinux file context, `_default' feature works as for `seuser'. [Default: (null)] - seuser User part of SELinux file context. Will default to system policy, if applicable. If set to `_default', it will use the `user' portion of the policy if available. [Default: (null)] - src Local path to a file to copy to the remote server; can be absolute or relative. If path is a directory, it is copied recursively. In this case, if path ends with "/", only inside contents of that directory are copied to destination. Otherwise, if it does not end with "/", the directory itself with all contents is copied. This behavior is similar to Rsync. [Default: (null)] - unsafe_writes Normally this module uses atomic operations to prevent data corruption or inconsistent reads from the target files, sometimes systems are configured or just broken in ways that prevent this. One example are docker mounted files, they cannot be updated atomically and can only be done in an unsafe manner. This boolean option allows ansible to fall back to unsafe methods of updating files for those cases in which you do not have any other choice. Be aware that this is subject to race conditions and can lead to data corruption. [Default: no] type: bool version_added: 2.2 - validate The validation command to run before copying into place. The path to the file to validate is passed in via '%s' which must be present as in the example below. The command is passed securely so shell features like expansion and pipes won't work. [Default: (null)] NOTES: * The [copy] module recursively copy facility does not scale to lots (>hundreds) of files. For alternative, see [synchronize] module, which is a wrapper around `rsync'. * For Windows targets, use the [win_copy] module instead. AUTHOR: Ansible Core Team, Michael DeHaan METADATA: status: - stableinterface supported_by: core

    Modules Documentation

    Also displays usable copy / paste examples of working functional tasks with this module.

    [ansible@redhat] $ ansible-doc copy
    
    EXAMPLES: - name: example copying file with owner and permissions copy: src: /srv/myfiles/foo.conf dest: /etc/foo.conf owner: foo group: foo mode: 0644 - name: The same example as above, but using a symbolic mode equivalent to 0644 copy: src: /srv/myfiles/foo.conf dest: /etc/foo.conf owner: foo group: foo mode: u=rw,g=r,o=r - name: Another symbolic mode example, adding some permissions and removing others copy: src: /srv/myfiles/foo.conf dest: /etc/foo.conf owner: foo group: foo mode: u+rw,g-wx,o-rwx - name: Copy a new "ntp.conf file into place, backing up the original if it differs from the... copy: src: /mine/ntp.conf dest: /etc/ntp.conf owner: root group: root mode: 0644 backup: yes - name: Copy a new "sudoers" file into place, after passing validation with visudo copy: src: /mine/sudoers dest: /etc/sudoers validate: /usr/sbin/visudo -cf %s - name: Copy a "sudoers" file on the remote machine for editing copy: src: /etc/sudoers dest: /etc/sudoers.edit remote_src: yes validate: /usr/sbin/visudo -cf %s - name: Copy using the 'content' for inline data copy: content: '# This file was moved to /etc/other.conf' dest: /etc/mine.conf' RETURN VALUES: dest: description: destination file/path returned: success type: string sample: /path/to/file.txt src: description: source file used for the copy on the target machine returned: changed type: string sample: /home/httpd/.ansible/tmp/ansible-tmp-1423796390.97-147729857856000/source md5sum: description: md5 checksum of the file after running copy returned: when supported type: string sample: 2a5aeecc61dc98c4d780b14b330e3282 checksum: description: sha1 checksum of the file after running copy returned: success type: string sample: 6e642bb8dd5c2e027bf21dd923337cbb4214f827 backup_file: description: name of backup file created returned: changed and if backup=yes type: string sample: /path/to/file.txt.2015-02-12@22:09~ gid: description: group id of the file, after execution returned: success type: int sample: 100 group: description: group of the file, after execution returned: success type: string sample: httpd owner: description: owner of the file, after execution returned: success type: string sample: httpd uid: description: owner id of the file, after execution returned: success type: int sample: 100 mode: description: permissions of the target, after execution returned: success type: string sample: 0644 size: description: size of the target, after execution returned: success type: int sample: 1220 state: description: state of the target, after execution returned: success type: string sample: file

    Modules Documentation

    Starting with the snippet view, you can create your task from pre-formatted scratch.

    [ansible@redhat] $ ansible-doc copy -s
    
    - name: Copies files to remote locations copy: attributes: # Attributes the file or directory should have. To get supported flags look at the man page for `chattr' on the target system. This string should contain the attributes in the same order as the one displayed by `lsattr'. backup: # Create a backup file including the timestamp information so you can get the original file back if you somehow clobbered it incorrectly. checksum: # SHA1 checksum of the file being transferred. Used to validate that the copy of the file was successful. If this is not provided, ansible will use the local calculated checksum of the src file. content: # When used instead of `src', sets the contents of a file directly to the specified value. For anything advanced or with formatting also look at the template module. decrypt: # This option controls the autodecryption of source files using vault. dest: # (required) Remote absolute path where the file should be copied to. If `src' is a directory, this must be a directory too. If `dest' is a nonexistent path and if either `dest' ends with "/" or `src' is a directory, `dest' is created. If `src' and `dest' are files, the parent directory of `dest' isn't created: the task fails if it doesn't already exist. directory_mode: # When doing a recursive copy set the mode for the directories. If this is not set we will use the system defaults. The mode is only set on directories which are newly created, and will not affect those that already existed. follow: # This flag indicates that filesystem links in the destination, if they exist, should be followed. force: # the default is `yes', which will replace the remote file when contents are different than the source. If `no', the file will only be transferred if the destination does not exist. group: # Name of the group that should own the file/directory, as would be fed to `chown'. local_follow: # This flag indicates that filesystem links in the source tree, if they exist, should be followed. mode: # Mode the file or directory should be. For those used to `/usr/bin/chmod' remember that modes are actually octal numbers. You must either specify the leading zero so that Ansible's YAML parser knows it is an octal number (like `0644' or `01777') or quote it (like `'644'' or `'0644'' so Ansible receives a string and can do its own conversion from string into number. Giving Ansible a number without following one of these rules will end up with a decimal number which will have unexpected results. As of version 1.8, the mode may be specified as a symbolic mode (for example, `u+rwx' or `u=rw,g=r,o=r'). As of version 2.3, the mode may also be the special string `preserve'. `preserve' means that the file will be given the same permissions as the source file. owner: # Name of the user that should own the file/directory, as would be fed to `chown'. remote_src: # If `no', it will search for `src' at originating/master machine. If `yes' it will go to the remote/target machine for the `src'. Default is `no'. Currently `remote_src' does not support recursive copying. `remote_src' only works with `mode=preserve' as of version 2.6. selevel: # Level part of the SELinux file context. This is the MLS/MCS attribute, sometimes known as the `range'. `_default' feature works as for `seuser'. serole: # Role part of SELinux file context, `_default' feature works as for `seuser'. setype: # Type part of SELinux file context, `_default' feature works as for `seuser'. seuser: # User part of SELinux file context. Will default to system policy, if applicable. If set to `_default', it will use the `user' portion of the policy if available. src: # Local path to a file to copy to the remote server; can be absolute or relative. If path is a directory, it is copied recursively. In this case, if path ends with "/", only inside contents of that directory are copied to destination. Otherwise, if it does not end with "/", the directory itself with all contents is copied. This behavior is similar to Rsync. unsafe_writes: # Normally this module uses atomic operations to prevent data corruption or inconsistent reads from the target files, sometimes systems are configured or just broken in ways that prevent this. One example are docker mounted files, they cannot be updated atomically and can only be done in an unsafe manner. This boolean option allows ansible to fall back to unsafe methods of updating files for those cases in which you do not have any other choice. Be aware that this is subject to race conditions and can lead to data corruption. validate: # The validation command to run before copying into place. The path to the file to validate is passed in via '%s' which must be present as in the example below. The command is passed securely so shell features like expansion and pipes won't work.

    Modules Documentation

    Modules: Run Commands

    If Ansible doesn't have a module that suits your needs there are the “run command” modules:


    • command: Takes the command and executes it on the host. The most secure and predictable.
    • shell: Executes through a shell like /bin/sh so you can use pipes etc. Be careful.
    • raw: Executes a command without going through the Ansible module subsystem.


    NOTE: Unlike standard modules, run commands have no concept of desired state and should only be used as a last resort.

    INVENTORY

    Define hosts on which the playbook will run.

    Inventory

    Inventory is a collection of hosts (nodes) with associated data and groupings that Ansible can connect and manage.

    • Hosts (nodes)
    • Groups
    • Inventory-specific data (variables)
    • Static or dynamic sources

    Static Inventory Example

    Ansible Terminal
    # Static inventory example:
    [myservers]
    10.42.0.2
    10.42.0.6
    10.42.0.7
    10.42.0.8
    10.42.0.100
    host.example.com
    
        

    A MORE ADVANCED STATIC INVENTORY EXAMPLE

    Ansible Terminal
    # A more advanced static inventory example:
    [control]
    mainserver ansible_host=10.42.0.2
    
    [web]
    node-[1:30] ansible_host=10.42.0.[31:60]
    
    [haproxy]
    haproxy ansible_host=10.42.0.100
    
    [all:vars]
    ansible_user=kev
    ansible_ssh_private_key_file=/home/kev/.ssh/id_rsa
        

    A MORE ADVANCED STATIC INVENTORY EXAMPLE

    Ansible Terminal
    # A more advanced static inventory example:
    [control]
    mainserver ansible_host=10.42.0.2
    
    [web]
    node-[1:30] ansible_host=10.42.0.[31:60]
    
    [haproxy]
    haproxy ansible_host=10.42.0.100
    
    [all:vars]
    ansible_user=kev
    ansible_ssh_private_key_file=/home/kev/.ssh/id_rsa
        

    A MORE ADVANCED STATIC INVENTORY EXAMPLE

    Ansible Terminal
    # A more advanced static inventory example:
    [control]
    mainserver ansible_host=10.42.0.2
    
    [web]
    node-[1:30] ansible_host=10.42.0.[31:60]
    
    [haproxy]
    haproxy ansible_host=10.42.0.100
    
    [all:vars]
    ansible_user=kev
    ansible_ssh_private_key_file=/home/kev/.ssh/id_rsa
        

    A MORE ADVANCED STATIC INVENTORY EXAMPLE

    Ansible Terminal
    # A more advanced static inventory example:
    [control]
    mainserver ansible_host=10.42.0.2
    
    [web]
    node-[1:30] ansible_host=10.42.0.[31:60]
    
    [haproxy]
    haproxy ansible_host=10.42.0.100
    
    [all:vars]
    ansible_user=kev
    ansible_ssh_private_key_file=/home/kev/.ssh/id_rsa
        

    A WINDOWS STATIC INVENTORY EXAMPLE

    Ansible Terminal
    # Windows vars inventory example:
    [winservers]
    blueiris	ansible_host=10.10.2.20
    winfileprd[1:3]	ansible_host=10.13.128.[7:9]
    winwebsrv01	ansible_host=10.14.27.16
    
    [winservers:vars]
    ansible_connection=winrm
    ansible_winrm_transport=credssp
    ansible_port=5986
    ansible_winrm_server_cert_validation=ignore
        

    A WINDOWS STATIC INVENTORY EXAMPLE

    Ansible Terminal
    # Windows vars inventory example:
    [winservers]
    blueiris	ansible_host=10.10.2.20
    winfileprd[1:3]	ansible_host=10.13.128.[7:9]
    winwebsrv01	ansible_host=10.14.27.16
    
    [winservers:vars]
    ansible_connection=winrm                   
    ansible_winrm_transport=credssp            
    ansible_port=5986                          
    ansible_winrm_server_cert_validation=ignore
        

    AD-HOC COMMANDS

    An ad-hoc command is a single Ansible task to perform quickly, but don’t want to save for later.

    Ad-Hoc Commands: Common Options

    • -m MODULE_NAME, --module-name=MODULE_NAME
      Module name to execute the ad-hoc command
    • -a MODULE_ARGS, --args=MODULE_ARGS
      Module arguments for the ad-hoc command
    • -b, --become
      Run ad-hoc command with elevated rights such as sudo, the default method
    • -e EXTRA_VARS, --extra-vars=EXTRA_VARS
      Set additional variables as key=value or YAML/JSON
    • --version
      Display the version of Ansible
    • --help
      Display the MAN page for the Ansible tool

    AD HOC COMMANDS

    Ansible Terminal
    # Check connections (submarine ping, not ICMP)
    [ansible@redhat] $ ansible all -m ping
    
    # Run a command on all the hosts in the web group
    [ansible@redhat] $ ansible web -m command -a "uptime"
    
    # Collect and display known facts
    [ansible@redhat] $ ansible localhost -m setup
        

    Full Fact List

    Returns a list of literally every fact available on the system

    [ansible@redhat] $ ansible myserver.mine -m setup 
    Provides a long list of all facts known of this system
    
    
    localhost | SUCCESS => { "ansible_facts": { "ansible_all_ipv4_addresses": [ "10.0.20.5" ], "ansible_all_ipv6_addresses": [ "fe80::4e98:35fe:3b14:33dc" ], "ansible_apparmor": { "status": "disabled" }, "ansible_architecture": "x86_64", "ansible_bios_date": "04/05/2016", "ansible_bios_version": "6.00", "ansible_cmdline": { "BOOT_IMAGE": "/vmlinuz-3.10.0-693.21.1.el7.x86_64", "LANG": "en_US.UTF-8", "crashkernel": "auto", "quiet": true, "rhgb": true, "ro": true, "root": "UUID=d49a9903-d546-4981-bffb-4e5147e1199b" }, "ansible_date_time": { "date": "2018-08-14", "day": "14", "epoch": "1534279494", "hour": "16", "iso8601": "2018-08-14T20:44:54Z", "iso8601_basic": "20180814T164454915629", "iso8601_basic_short": "20180814T164454", "iso8601_micro": "2018-08-14T20:44:54.915745Z", "minute": "44", "month": "08", "second": "54", "time": "16:44:54", "tz": "EDT", "tz_offset": "-0400", "weekday": "Tuesday", "weekday_number": "2", "weeknumber": "33", "year": "2018" }, "ansible_default_ipv4": { "address": "10.0.20.5", "alias": "ens192", "broadcast": "10.0.20.255", "gateway": "10.0.20.1", "interface": "ens192", "macaddress": "00:50:56:bb:30:e8", "mtu": 1500, "netmask": "255.255.255.0", "network": "10.0.20.0", "type": "ether" }, "ansible_default_ipv6": {}, "ansible_device_links": { "ids": { "sr0": [ "ata-VMware_Virtual_SATA_CDRW_Drive_00000000000000000001" ] }, "labels": {}, "masters": {}, "uuids": { "sda1": [ "619dcc55-451d-44be-b364-8c94278c567c" ], "sda2": [ "d49a9903-d546-4981-bffb-4e5147e1199b" ] } }, "ansible_devices": { "sda": { "holders": [], "host": "Serial Attached SCSI controller: VMware PVSCSI SCSI Controller (rev 02)", "links": { "ids": [], "labels": [], "masters": [], "uuids": [] }, "model": "Virtual disk", "partitions": { "sda1": { "holders": [], "links": { "ids": [], "labels": [], "masters": [], "uuids": [ "619dcc55-451d-44be-b364-8c94278c567c" ] }, "sectors": "2097152", "sectorsize": 512, "size": "1.00 GB", "start": "2048", "uuid": "619dcc55-451d-44be-b364-8c94278c567c" }, "sda2": { "holders": [], "links": { "ids": [], "labels": [], "masters": [], "uuids": [ "d49a9903-d546-4981-bffb-4e5147e1199b" ] }, "sectors": "31455232", "sectorsize": 512, "size": "15.00 GB", "start": "2099200", "uuid": "d49a9903-d546-4981-bffb-4e5147e1199b" } }, "removable": "0", "rotational": "1", "sas_address": null, "sas_device_handle": null, "scheduler_mode": "deadline", "sectors": "41943040", "sectorsize": "512", "size": "20.00 GB", "support_discard": "0", "vendor": "VMware", "virtual": 1 }, "sr0": { "holders": [], "host": "SATA controller: VMware SATA AHCI controller", "links": { "ids": [ "ata-VMware_Virtual_SATA_CDRW_Drive_00000000000000000001" ], "labels": [], "masters": [], "uuids": [] }, "model": "VMware SATA CD00", "partitions": {}, "removable": "1", "rotational": "1", "sas_address": null, "sas_device_handle": null, "scheduler_mode": "cfq", "sectors": "2097151", "sectorsize": "512", "size": "1024.00 MB", "support_discard": "0", "vendor": "NECVMWar", "virtual": 1 } }, "ansible_distribution": "CentOS", "ansible_distribution_file_parsed": true, "ansible_distribution_file_path": "/etc/redhat-release", "ansible_distribution_file_variety": "RedHat", "ansible_distribution_major_version": "7", "ansible_distribution_release": "Core", "ansible_distribution_version": "7.4.1708", "ansible_dns": { "nameservers": [ "10.0.20.1" ], "search": [ "kev" ] }, "ansible_domain": "kev", "ansible_effective_group_id": 0, "ansible_effective_user_id": 0, "ansible_ens192": { "active": true, "device": "ens192", "features": { "busy_poll": "off [fixed]", "fcoe_mtu": "off [fixed]", "generic_receive_offload": "on", "generic_segmentation_offload": "on", "highdma": "on", "hw_tc_offload": "off [fixed]", "l2_fwd_offload": "off [fixed]", "large_receive_offload": "on", "loopback": "off [fixed]", "netns_local": "off [fixed]", "ntuple_filters": "off [fixed]", "receive_hashing": "off [fixed]", "rx_all": "off [fixed]", "rx_checksumming": "on", "rx_fcs": "off [fixed]", "rx_vlan_filter": "on [fixed]", "rx_vlan_offload": "on", "rx_vlan_stag_filter": "off [fixed]", "rx_vlan_stag_hw_parse": "off [fixed]", "scatter_gather": "on", "tcp_segmentation_offload": "on", "tx_checksum_fcoe_crc": "off [fixed]", "tx_checksum_ip_generic": "on", "tx_checksum_ipv4": "off [fixed]", "tx_checksum_ipv6": "off [fixed]", "tx_checksum_sctp": "off [fixed]", "tx_checksumming": "on", "tx_fcoe_segmentation": "off [fixed]", "tx_gre_csum_segmentation": "off [fixed]", "tx_gre_segmentation": "off [fixed]", "tx_gso_partial": "off [fixed]", "tx_gso_robust": "off [fixed]", "tx_ipip_segmentation": "off [fixed]", "tx_lockless": "off [fixed]", "tx_mpls_segmentation": "off [fixed]", "tx_nocache_copy": "off", "tx_scatter_gather": "on", "tx_scatter_gather_fraglist": "off [fixed]", "tx_sctp_segmentation": "off [fixed]", "tx_sit_segmentation": "off [fixed]", "tx_tcp6_segmentation": "on", "tx_tcp_ecn_segmentation": "off [fixed]", "tx_tcp_mangleid_segmentation": "off", "tx_tcp_segmentation": "on", "tx_udp_tnl_csum_segmentation": "off [fixed]", "tx_udp_tnl_segmentation": "off [fixed]", "tx_vlan_offload": "on", "tx_vlan_stag_hw_insert": "off [fixed]", "udp_fragmentation_offload": "off [fixed]", "vlan_challenged": "off [fixed]" }, "hw_timestamp_filters": [], "ipv4": { "address": "10.0.20.5", "broadcast": "10.0.20.255", "netmask": "255.255.255.0", "network": "10.0.20.0" }, "ipv6": [ { "address": "fe80::4e98:35fe:3b14:33dc", "prefix": "64", "scope": "link" } ], "macaddress": "00:50:56:bb:30:e8", "module": "vmxnet3", "mtu": 1500, "pciid": "0000:0b:00.0", "promisc": false, "speed": 10000, "timestamping": [ "rx_software", "software" ], "type": "ether" }, "ansible_env": { "HISTCONTROL": "ignoredups", "HISTSIZE": "1000", "HOME": "/root", "HOSTNAME": "myserver", "LANG": "en_US.UTF-8", "LESSOPEN": "||/usr/bin/lesspipe.sh %s", "LOGNAME": "root", "LS_COLORS": "rs=0:di=38;5;27:ln=38;5;51:mh=44;38;5;15:pi=40;38;5;11:so=38;5;13:do=38;5;5:bd=48;5;232;38;5;11:cd=48;5;232;38;5;3:or=48;5;232;38;5;9:mi=05;48;5;232;38;5;15:su=48;5;196;38;5;15:sg=48;5;11;38;5;16:ca=48;5;196;38;5;226:tw=48;5;10;38;5;16:ow=48;5;10;38;5;21:st=48;5;21;38;5;15:ex=38;5;34:*.tar=38;5;9:*.tgz=38;5;9:*.arc=38;5;9:*.arj=38;5;9:*.taz=38;5;9:*.lha=38;5;9:*.lz4=38;5;9:*.lzh=38;5;9:*.lzma=38;5;9:*.tlz=38;5;9:*.txz=38;5;9:*.tzo=38;5;9:*.t7z=38;5;9:*.zip=38;5;9:*.z=38;5;9:*.Z=38;5;9:*.dz=38;5;9:*.gz=38;5;9:*.lrz=38;5;9:*.lz=38;5;9:*.lzo=38;5;9:*.xz=38;5;9:*.bz2=38;5;9:*.bz=38;5;9:*.tbz=38;5;9:*.tbz2=38;5;9:*.tz=38;5;9:*.deb=38;5;9:*.rpm=38;5;9:*.jar=38;5;9:*.war=38;5;9:*.ear=38;5;9:*.sar=38;5;9:*.rar=38;5;9:*.alz=38;5;9:*.ace=38;5;9:*.zoo=38;5;9:*.cpio=38;5;9:*.7z=38;5;9:*.rz=38;5;9:*.cab=38;5;9:*.jpg=38;5;13:*.jpeg=38;5;13:*.gif=38;5;13:*.bmp=38;5;13:*.pbm=38;5;13:*.pgm=38;5;13:*.ppm=38;5;13:*.tga=38;5;13:*.xbm=38;5;13:*.xpm=38;5;13:*.tif=38;5;13:*.tiff=38;5;13:*.png=38;5;13:*.svg=38;5;13:*.svgz=38;5;13:*.mng=38;5;13:*.pcx=38;5;13:*.mov=38;5;13:*.mpg=38;5;13:*.mpeg=38;5;13:*.m2v=38;5;13:*.mkv=38;5;13:*.webm=38;5;13:*.ogm=38;5;13:*.mp4=38;5;13:*.m4v=38;5;13:*.mp4v=38;5;13:*.vob=38;5;13:*.qt=38;5;13:*.nuv=38;5;13:*.wmv=38;5;13:*.asf=38;5;13:*.rm=38;5;13:*.rmvb=38;5;13:*.flc=38;5;13:*.avi=38;5;13:*.fli=38;5;13:*.flv=38;5;13:*.gl=38;5;13:*.dl=38;5;13:*.xcf=38;5;13:*.xwd=38;5;13:*.yuv=38;5;13:*.cgm=38;5;13:*.emf=38;5;13:*.axv=38;5;13:*.anx=38;5;13:*.ogv=38;5;13:*.ogx=38;5;13:*.aac=38;5;45:*.au=38;5;45:*.flac=38;5;45:*.mid=38;5;45:*.midi=38;5;45:*.mka=38;5;45:*.mp3=38;5;45:*.mpc=38;5;45:*.ogg=38;5;45:*.ra=38;5;45:*.wav=38;5;45:*.axa=38;5;45:*.oga=38;5;45:*.spx=38;5;45:*.xspf=38;5;45:", "MAIL": "/var/spool/mail/root", "PATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin", "PWD": "/root", "SHELL": "/bin/bash", "SHLVL": "3", "SSH_CLIENT": "10.0.0.74 53446 22", "SSH_CONNECTION": "10.0.0.74 53446 10.0.20.5 22", "SSH_TTY": "/dev/pts/0", "TERM": "xterm-256color", "USER": "root", "XDG_RUNTIME_DIR": "/run/user/0", "XDG_SESSION_ID": "270", "_": "/usr/bin/python2" }, "ansible_fips": false, "ansible_form_factor": "Other", "ansible_fqdn": "myserver.mine", "ansible_hostname": "myserver", "ansible_interfaces": [ "lo", "ens192" ], "ansible_is_chroot": false, "ansible_iscsi_iqn": "", "ansible_kernel": "3.10.0-693.21.1.el7.x86_64", "ansible_lo": { "active": true, "device": "lo", "features": { "busy_poll": "off [fixed]", "fcoe_mtu": "off [fixed]", "generic_receive_offload": "on", "generic_segmentation_offload": "on", "highdma": "on [fixed]", "hw_tc_offload": "off [fixed]", "l2_fwd_offload": "off [fixed]", "large_receive_offload": "off [fixed]", "loopback": "on [fixed]", "netns_local": "on [fixed]", "ntuple_filters": "off [fixed]", "receive_hashing": "off [fixed]", "rx_all": "off [fixed]", "rx_checksumming": "on [fixed]", "rx_fcs": "off [fixed]", "rx_vlan_filter": "off [fixed]", "rx_vlan_offload": "off [fixed]", "rx_vlan_stag_filter": "off [fixed]", "rx_vlan_stag_hw_parse": "off [fixed]", "scatter_gather": "on", "tcp_segmentation_offload": "on", "tx_checksum_fcoe_crc": "off [fixed]", "tx_checksum_ip_generic": "on [fixed]", "tx_checksum_ipv4": "off [fixed]", "tx_checksum_ipv6": "off [fixed]", "tx_checksum_sctp": "on [fixed]", "tx_checksumming": "on", "tx_fcoe_segmentation": "off [fixed]", "tx_gre_csum_segmentation": "off [fixed]", "tx_gre_segmentation": "off [fixed]", "tx_gso_partial": "off [fixed]", "tx_gso_robust": "off [fixed]", "tx_ipip_segmentation": "off [fixed]", "tx_lockless": "on [fixed]", "tx_mpls_segmentation": "off [fixed]", "tx_nocache_copy": "off [fixed]", "tx_scatter_gather": "on [fixed]", "tx_scatter_gather_fraglist": "on [fixed]", "tx_sctp_segmentation": "on", "tx_sit_segmentation": "off [fixed]", "tx_tcp6_segmentation": "on", "tx_tcp_ecn_segmentation": "on", "tx_tcp_mangleid_segmentation": "on", "tx_tcp_segmentation": "on", "tx_udp_tnl_csum_segmentation": "off [fixed]", "tx_udp_tnl_segmentation": "off [fixed]", "tx_vlan_offload": "off [fixed]", "tx_vlan_stag_hw_insert": "off [fixed]", "udp_fragmentation_offload": "on", "vlan_challenged": "on [fixed]" }, "hw_timestamp_filters": [], "ipv4": { "address": "127.0.0.1", "broadcast": "host", "netmask": "255.0.0.0", "network": "127.0.0.0" }, "ipv6": [ { "address": "::1", "prefix": "128", "scope": "host" } ], "mtu": 65536, "promisc": false, "timestamping": [ "rx_software", "software" ], "type": "loopback" }, "ansible_local": { "is_installed": { "is_vim_installed": { "vim": "true" } }, "package_list": { "all_kev_packages": { "package1": "acl-2.2.51-12.el7.x86_64", "package10": "authconfig-6.2.8-30.el7.x86_64", "package11": "basesystem-10.0-7.el7.centos.noarch", "package2": "aic94xx-firmware-30-6.el7.noarch", "package3": "alsa-firmware-1.0.28-2.el7.noarch", "package4": "alsa-lib-1.1.3-3.el7.x86_64", "package5": "alsa-tools-firmware-1.1.0-1.el7.x86_64", "package6": "ansible-2.6.1-1.el7.noarch", "package7": "ansible-lint-3.4.21-1.el7.noarch", "package8": "audit-2.7.6-3.el7.x86_64", "package9": "audit-libs-2.7.6-3.el7.x86_64" } }, "system_owner": { "system_owner": { "owner": "kev" } } }, "ansible_lsb": {}, "ansible_machine": "x86_64", "ansible_machine_id": "072bb764550746bd9695d73f43c9cf3b", "ansible_memfree_mb": 1307, "ansible_memory_mb": { "nocache": { "free": 1579, "used": 260 }, "real": { "free": 1307, "total": 1839, "used": 532 }, "swap": { "cached": 0, "free": 0, "total": 0, "used": 0 } }, "ansible_memtotal_mb": 1839, "ansible_mounts": [ { "block_available": 3300883, "block_size": 4096, "block_total": 3929344, "block_used": 628461, "device": "/dev/sda2", "fstype": "xfs", "inode_available": 7804215, "inode_total": 7863808, "inode_used": 59593, "mount": "/", "options": "rw,relatime,attr2,inode64,noquota", "size_available": 13520416768, "size_total": 16094593024, "uuid": "d49a9903-d546-4981-bffb-4e5147e1199b" }, { "block_available": 207739, "block_size": 4096, "block_total": 259584, "block_used": 51845, "device": "/dev/sda1", "fstype": "xfs", "inode_available": 523947, "inode_total": 524288, "inode_used": 341, "mount": "/boot", "options": "rw,relatime,attr2,inode64,noquota", "size_available": 850898944, "size_total": 1063256064, "uuid": "619dcc55-451d-44be-b364-8c94278c567c" } ], "ansible_nodename": "myserver", "ansible_os_family": "RedHat", "ansible_pkg_mgr": "yum", "ansible_processor": [ "0", "GenuineIntel", "Intel(R) Xeon(R) CPU X5660 @ 2.80GHz" ], "ansible_processor_cores": 1, "ansible_processor_count": 1, "ansible_processor_threads_per_core": 1, "ansible_processor_vcpus": 1, "ansible_product_name": "VMware Virtual Platform", "ansible_product_serial": "VMware-42 3b 24 ce 91 e0 3a be-b1 02 3c 83 0f 86 02 e8", "ansible_product_uuid": "CE243B42-E091-BE3A-B102-3C830F8602E8", "ansible_product_version": "None", "ansible_python": { "executable": "/usr/bin/python2", "has_sslcontext": true, "type": "CPython", "version": { "major": 2, "micro": 5, "minor": 7, "releaselevel": "final", "serial": 0 }, "version_info": [ 2, 7, 5, "final", 0 ] }, "ansible_python_version": "2.7.5", "ansible_real_group_id": 0, "ansible_real_user_id": 0, "ansible_selinux": { "status": "disabled" }, "ansible_selinux_python_present": true, "ansible_service_mgr": "systemd", "ansible_ssh_host_key_ecdsa_public": "AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBHa2kNk4tpZ4/rXxM6969XkR29JQa91M7sSRHheXeQxmZjnRp/5o2ADQjFmXz+PouYA8PMiBU9u5Mx44oEXxDmU=", "ansible_ssh_host_key_ed25519_public": "AAAAC3NzaC1lZDI1NTE5AAAAIE5MKxH1C+uyIHjAz48pwHj+6HdXw/9vCnc2PHRQZVND", "ansible_ssh_host_key_rsa_public": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDMNVNNOgPb+L9rnrm0D2dQWRVEjtnWAgbgVDtdixE79+jDR5TGfxuUmf74yRXM0flrdvirQtBvZjSwsj3/fUReUas0gt3LVs1b7jsxK6QeGgQCx6CCeopMgUb0JYXsMexbekZxxnpBcWAXh/Bjhko/8FpZaZhIvk0VTzQMCP7+/netcTi1m+CCCF1YhQmy8bGhN+aJuaaP2VMSDSauOFGUQUUaJkw+pjata+qWMwYemDabszkePFp0rBQEDSo6fIMlXvInm75Jf24tyb+X9+kOycGk4Rits/jXseB6j+L3rZRCX6b/F3JMNtqoBc7nybGvD/8Njn9Sl67DQUZenkcX", "ansible_swapfree_mb": 0, "ansible_swaptotal_mb": 0, "ansible_system": "Linux", "ansible_system_capabilities": [ "cap_chown", "cap_dac_override", "cap_dac_read_search", "cap_fowner", "cap_fsetid", "cap_kill", "cap_setgid", "cap_setuid", "cap_setpcap", "cap_linux_immutable", "cap_net_bind_service", "cap_net_broadcast", "cap_net_admin", "cap_net_raw", "cap_ipc_lock", "cap_ipc_owner", "cap_sys_module", "cap_sys_rawio", "cap_sys_chroot", "cap_sys_ptrace", "cap_sys_pacct", "cap_sys_admin", "cap_sys_boot", "cap_sys_nice", "cap_sys_resource", "cap_sys_time", "cap_sys_tty_config", "cap_mknod", "cap_lease", "cap_audit_write", "cap_audit_control", "cap_setfcap", "cap_mac_override", "cap_mac_admin", "cap_syslog", "35", "36+ep" ], "ansible_system_capabilities_enforced": "True", "ansible_system_vendor": "VMware, Inc.", "ansible_uptime_seconds": 137627, "ansible_user_dir": "/root", "ansible_user_gecos": "root", "ansible_user_gid": 0, "ansible_user_id": "root", "ansible_user_shell": "/bin/bash", "ansible_user_uid": 0, "ansible_userspace_architecture": "x86_64", "ansible_userspace_bits": "64", "ansible_virtualization_role": "guest", "ansible_virtualization_type": "VMware", "gather_subset": [ "all" ], "module_setup": true }, "changed": false }

    DISCOVERED FACTS

    Ansible Terminal
    # Small filtered subset of discovered facts
    [ansible@redhat] $ ansible myserver.mine -m setup -a "filter=ansible_default_ipv4"
    
    myserver.mine | success >> {
      "ansible_facts": {
          "ansible_default_ipv4": {
              "address": "10.41.17.37",
              "alias": "eth0",
              "gateway": "10.41.17.1",
              "interface": "eth0",
              "macaddress": "00:69:08:3b:a9:16",
              "mtu": 1500,
              "netmask": "255.255.255.0",
              "network": "10.41.17.0",
              "type": "ether"
          },
        

    VARIABLES:

  • What are they?
  • How do they work for me?
  • What can I do with them?
  • How do I override or redefine them in flight?
  • Variables

    Ansible can work with metadata from various sources and manage their context in the form of variables.

    • Command line parameters
    • Plays and tasks
    • Files
    • Inventory
    • Discovered facts
    • Roles

    Variable Precedence

    The order in which the same variable from different sources will override each other.

    1. extra vars
    2. task vars (only for the task)
    3. block vars (only for tasks in block)
    4. role and include vars
    5. play vars_files
    6. play vars_prompt
    7. play vars
    8. set_facts
    1. registered vars
    2. host facts
    3. playbook host_vars
    4. playbook group_vars
    5. inventory host_vars
    6. inventory group_vars
    7. inventory vars
    8. role defaults

    Tasks in a Play

    Tasks are the powerful pieces within a playbook that state paremeters and instruct the Ansible engine

    Tasks

    Tasks are the application of a module to perform a specific unit of work.

    • file: A directory should exist
    • yum: A package should be installed
    • service: A service should be running
    • template: Render a configuration file from a template
    • get_url: Fetch an archive file from a URL
    • git: Clone a source code repository

    EXAMPLE TASKS IN A PLAY

    Ansible Terminal
    ---
    tasks:
    - name: Ensure httpd package is present
      yum:
        name: httpd
        state: latest
    
    - name: Ensure latest index.html file is present
      copy:
        src: files/index.html
        dest: /var/www/html/
    
    - name: Restart httpd
      service:
        name: httpd
        state: restarted
        

    Handler Tasks

    Handlers are special tasks that run at the end of a play if notified by another task when a change occurs.

    If a package gets installed or updated, notify a service restart task that it needs to run.

    Example Handler Task in a Play

    Ansible Terminal
      tasks:
    
      - name: Ensure httpd package is present
        yum:
          name: httpd
          state: latest
        notify: httpd_running
    
      - name: Verify correct config file is present
        copy:
          src: files/index.html
          dest: /var/www/html/index.html
    
      handlers:
    
      - name: httpd_running
        service:
          name: httpd
          state: restarted
    			

    Example Handler Task in a Play

    Ansible Terminal
      tasks:
    
      - name: Ensure httpd package is present
        yum:
          name: httpd
          state: latest
        notify: httpd_running                                    
    
      - name: Verify correct config file is present
        copy:
          src: files/index.html
          dest: /var/www/html/index.html
    
      handlers:
    
      - name: httpd_running
        service:
          name: httpd
          state: restarted
    			

    Example Handler Task in a Play

    Ansible Terminal
      tasks:
    
      - name: Ensure httpd package is present
        yum:
          name: httpd
          state: latest
        notify: httpd_running
    
      - name: Verify correct config file is present
        copy:
          src: files/index.html
          dest: /var/www/html/index.html
    
      handlers:                                                  
    
      - name: httpd_running
        service:
          name: httpd
          state: restarted
    			

    Example Handler Task in a Play

    Ansible Terminal
      tasks:
    
      - name: Ensure httpd package is present
        yum:
          name: httpd
          state: latest
        notify: httpd_running
    
      - name: Verify correct config file is present
        copy:
          src: files/index.html
          dest: /var/www/html/index.html
    
      handlers:
    
      - name: httpd_running                                      
        service:
          name: httpd
          state: restarted
    			

    Example Handler Task in a Play

    Ansible Terminal
      tasks:
    
      - name: Ensure httpd package is present
        yum:
          name: httpd
          state: latest
        notify: httpd_running                                    
    
      - name: Verify correct config file is present
        copy:
          src: files/index.html
          dest: /var/www/html/index.html
    
      handlers:                                                  
                                                                 
      - name: httpd_running                                      
        service:
          name: httpd
          state: restarted
    			

    Multiple Tasks Calling a Handler in a Play

    Ansible Terminal
      tasks:
    
      - name: Ensure httpd package is present
        yum:
          name: httpd
          state: latest
        notify: httpd_running
    
      - name: Verify correct config file is present
        template:
          src: files/httpd.conf.j2
          dest: /etc/httpd/conf/httpd.conf
        notify: httpd_running
    
      handlers:
    
      - name: httpd_running
        service:
          name: httpd
          state: restarted
    			

    Multiple Tasks Calling a Handler in a Play

    Ansible Terminal
      tasks:
    
      - name: Ensure httpd package is present
        yum:
          name: httpd
          state: latest
        notify: httpd_running                                    
    
      - name: Verify correct config file is present
        template:
          src: files/httpd.conf.j2
          dest: /etc/httpd/conf/httpd.conf
        notify: httpd_running                                    
    
      handlers:
    
      - name: httpd_running
        service:
          name: httpd
          state: restarted
    			

    Multiple Tasks Calling a Handler in a Play

    Ansible Terminal
      tasks:
    
      - name: Ensure httpd package is present
        yum:
          name: httpd
          state: latest
        notify: httpd_running
    
      - name: Verify correct config file is present
        template:
          src: files/httpd.conf.j2
          dest: /etc/httpd/conf/httpd.conf
        notify: httpd_running
    
      handlers:                                                  
                                                                 
      - name: httpd_running                                      
        service:
          name: httpd
          state: restarted
    			

    Multiple Tasks Calling a Handler in a Play

    Ansible Terminal
      tasks:
      
      - name: Ensure httpd package is present
        yum:
          name: httpd
          state: latest
        notify: httpd_running                                    
    
      - name: Verify correct config file is present
        template:
          src: files/httpd.conf.j2
          dest: /etc/httpd/conf/httpd.conf
        notify: httpd_running                                    
    
      handlers:                                                  
                                                                 
      - name: httpd_running                                      
        service:
          name: httpd
          state: restarted
    			

    ANATOMY OF A PLAYBOOK

    Let's dissect the basics of a playbook and make sure we understand the core components.

    Plays & Playbooks

    Plays are ordered sets of tasks to execute against host selections from your inventory. A playbook is a file containing one or more plays.

    PLAYBOOK EXAMPLE

    Ansible Terminal
    - name: Ensure apache is installed and started
      hosts: web
      become: yes
    
      tasks:
      - name: Ensure httpd package is present
        yum:
          name: httpd
          state: latest
    
      - name: Ensure latest index.html file is present
        copy:
          src: files/index.html
          dest: /var/www/html/index.html
    
      - name: Ensure httpd is started
        service:
          name: httpd
          state: started
        

    HUMAN MEANINGFUL NAMING

    Ansible Terminal
    - name: Ensure apache is installed and started
      hosts: web
      become: yes
      
      tasks:
      - name: Ensure httpd package is present
        yum:
          name: httpd
          state: latest
    
      - name: Ensure latest index.html file is present
        copy:
          src: files/index.html
          dest: /var/www/html/
    
      - name: Ensure httpd is started
        service:
          name: httpd
          state: started
        

    HOST SELECTOR

    Ansible Terminal
    - name: Ensure apache is installed and started
      hosts: web
      become: yes
    
      tasks:
      - name: Ensure httpd package is present
        yum:
          name: httpd
          state: latest
    
      - name: Ensure latest index.html file is present
        copy:
          src: files/index.html
          dest: /var/www/html/
    
      - name: Ensure httpd is started
        service:
          name: httpd
          state: started
        

    PRIVILEGE ESCALATION

    Ansible Terminal
    - name: Ensure apache is installed and started
      hosts: web
      become: yes
    
      tasks:
      - name: Ensure httpd package is present
        yum:
          name: httpd
          state: latest
    
      - name: Ensure latest index.html file is present
        copy:
          src: files/index.html
          dest: /var/www/html/
    
      - name: Ensure httpd is started
        service:
          name: httpd
          state: started
        

    PLAY VARIABLES

    Ansible Terminal
    - name: Ensure apache is installed and started
      hosts: web
      become: yes
      vars:                                
        http_port: 80                      
        http_docroot: /var/www/gokev.com   
    
      tasks:
      - name: Ensure httpd package is present
        yum:
          name: httpd
          state: latest
    
      - name: Verify correct config file is present
        template:
          src: templates/httpd.conf.j2
          dest: /etc/httpd/conf/httpd.conf
    
      - name: Ensure httpd is started
        service:
          name: httpd
          state: started
        

    PLAYBOOK TASKS

    Ansible Terminal
    - name: Ensure apache is installed and started
      hosts: web
      become: yes
      vars:
        http_port: 80
        http_docroot: /var/www/gokev.com
    
      tasks:
      - name: Ensure latest httpd package is present
        yum:
          name: httpd
          state: latest
    
      - name: Verify correct config file is present
        template:
          src: templates/httpd.conf.j2
          dest: /etc/httpd/conf/httpd.conf
    
      - name: Ensure httpd is started
        service:
          name: httpd
          state: started
        

    DO MORE.

    Let's get a bit more advanced with some rich functionality that Ansible provides.

    Doing More with Playbooks

    Here are some more essential playbook features that you can apply:

    • Templates
    • Loops
    • Conditionals
    • Tags
    • Blocks

    Templates

    Ansible embeds the Jinja2 templating engine that can be used to dynamically:

    • Set and modify play variables
    • Conditional logic
    • Generate files such as configurations from variables

    WORKING WITH LOOPS

    Loops can do one task on multiple things: create a lot of users, install a lot of packages, or repeat a polling step until a certain result is reached.

    Ansible Terminal
    - yum:
        name: "{{ item }}"
        state: latest
      with_items:
      - httpd
      - mysql-server
      - php56-mysqlnd
      - php56-common
      - php56-gd
      - php56-soap
      - php56-xml
        

    WORKING WITH CONDITIONALS

    Ansible supports the conditional execution of a task based on the run-time evaluation of variable, fact, or previous task result.

    Ansible Terminal
    - yum:
        name: httpd
        state: latest
      when: ansible_os_family == "RedHat"
        

    WORKING WITH TAGS

    Tags are useful to be able to run a subset of a playbook on-demand.

    Ansible Terminal
    - yum:
        name: "{{ item }}"
        state: latest
      with_items:
      - httpd
      - php56
      tags:
         - packages
    
     - template:
         src: templates/httpd.conf.j2
         dest: /etc/httpd/conf/httpd.conf
      tags:
         - configuration
        

    WORKING WITH BLOCKS

    Blocks cut down on repetitive task directives, allow for logical grouping of tasks and even in play error handling.

    Ansible Terminal
      block:
      - yum:
          name: "{{ item }}"
          state: latest
        with_items:
        - httpd
        - php56
    
      - template:
          src: templates/httpd.conf.j2
          dest: /etc/httpd/conf/httpd.conf
      when: ansible_os_family == "RedHat"
        

    ANSIBLE VAULT:
    ENCRYPTION

    Using ansible-vault to keep your secrets a secret.


    ANSIBLE VAULT

    Encrypt an entire file or just a string inside a non-encrypted file.

    Ansible Terminal : Encrypted File
    [ansible@redhat] $ cat ronin_secret.yml 
    
    $ANSIBLE_VAULT;1.1;AES256
    61336361663664353737663637366334383030393736353532345
    66532383233393438653965633333326632363935663132326163
    306637626335643365630a653066396533313738316266653
    
    
    Ansible Terminal : Encrypted Variable
    [ansible@redhat] $ cat fonzie_secret.yml
    
    fonzie_show: Happy Days
    fonzie_secret: !vault |
              $ANSIBLE_VAULT;1.1;AES256
              6632363237353065633237633937353164646564633
              6376461326235386539663733343539666234332664
              6664616266316339383838373734653364346163633
              6663864366534633063303062363238393139
              
    

    ANSIBLE VAULT:
    ENCRYPTED FILE EXAMPLE

    (Variables In An Encrypted File)


    Encrypting Sensitive Variables Inside Your Playbooks With An Entire Encrypted YAML File

    ANSIBLE VAULT: COMPLETE ENCRYPTED FILE

    Encrypting an entire file with Ansible Vault.

    Ansible Terminal
    [ansible@redhat] $ ansible-vault create ronin_secret.yml
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    		    

    ANSIBLE VAULT: COMPLETE ENCRYPTED FILE

    Encrypting an entire file with Ansible Vault.

    Ansible Terminal
    [ansible@redhat] $ ansible-vault create ronin_secret.yml
    
    New Vault password: redhat
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    		    

    ANSIBLE VAULT: COMPLETE ENCRYPTED FILE

    Encrypting an entire file with Ansible Vault.

    Ansible Terminal
    [ansible@redhat] $ ansible-vault create ronin_secret.yml
    
    New Vault password: 
    Confirm New Vault password: 
    
     [WARNING]:  does not exist, creating...
    
    [ansible@redhat] $
    
    
    
    
    
    
    
    
    
    
    
    
    		    

    ANSIBLE VAULT: COMPLETE ENCRYPTED FILE

    Editing an encrypted file with Ansible Vault.

    Ansible Terminal
    [ansible@redhat] $ ansible-vault edit ronin_secret.yml 
    
    Vault password: redhat
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    		    

    ANSIBLE VAULT: COMPLETE ENCRYPTED FILE

    Editing an encrypted file with Ansible Vault.

    Ansible Terminal
    ~                                                                               
    ~                                                                               
    ~                                                                               
    ~                                                                               
    ~                                                                               
    ~                                                                               
    ~                                                                               
    ~                                                                               
    ~                                                                               
    ~                                                                               
    ~                                                                               
    ~                                                                               
    ~                                                                               
    ~                                                                               
    ~                                                                               
    ~                                                                               
    ~                                                                               
    ~                                                                               
    ~                                                                               
    ~                                                                               
    "/tmp/tmpQD4uZF.yml" 0L, 0C

    ANSIBLE VAULT: COMPLETE ENCRYPTED FILE

    Editing an encrypted file with Ansible Vault.

    Ansible Terminal
    movie_title: Ronin
    movie_phrase: 'Whenever there is any doubt, there is no doubt'
    movie_actor: Robert De Niro
    movie_character: Sam
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    ~
    :wq

    ANSIBLE VAULT: COMPLETE ENCRYPTED FILE

    Viewing an encrypted file with Ansible Vault without the password.

    Ansible Terminal
    [ansible@redhat] $ cat ronin_secret.yml 
    
    $ANSIBLE_VAULT;1.1;AES256
    6133636166366435373766363736633438303039373635353234
    6465306431313861616533653164373061323463356238323530
    6363383735336661323964330a30303730383863656633613862
    3339653531346137643334616664366532383233393438653965
    633333326632363935663132326163306637626335643365630a
    6530663965333137383162666538303062386539356366313237
    633531363239
    
    
    
    
    
    
    
    
    
    
    
    

    ANSIBLE VAULT: COMPLETE ENCRYPTED FILE

    Viewing an encrypted file with Ansible Vault with the password.

    Ansible Terminal
    [ansible@redhat] $ ansible-vault view ronin_secret.yml 
    
    Vault password:  redhat
    
    movie_title: Ronin
    movie_phrase: 'Whenever there is any doubt, there is no doubt'
    movie_actor: Robert De Niro
    movie_character: Sam
    
    
    
    
    
    
    
    
    
    
    
    
    
    

    ANSIBLE VAULT: COMPLETE ENCRYPTED FILE

    Including vaulted files in your playbook.

    Ansible Terminal
    ---
    - hosts: web
      become: yes
      vars:
        country_setting: France
        city_opening_scene: Montmartre
    
      vars_files:
        - ronin_secret.yml
    
      tasks:
      - name: Ensure httpd package is present
        yum:
          name: httpd
          state: latest
    
      - name: Verify correct index file is present
        template:
          src: templates/index.html.j2
          dest: /var/www/html/index.html
    
    

    ANSIBLE VAULT: COMPLETE ENCRYPTED FILE

    Including vaulted files in your playbook.

    Ansible Terminal
    ---
    - hosts: web
      become: yes
      vars:
        country_setting: France
        city_opening_scene: Montmartre
    
      vars_files:          
        - ronin_secret.yml 
    
      tasks:
      - name: Ensure httpd package is present
        yum:
          name: httpd
          state: latest
    
      - name: Verify correct index file is present
        template:
          src: templates/index.html.j2
          dest: /var/www/html/index.html
    
    

    ANSIBLE VAULT:
    ENCRYPTED STRING EXAMPLE

    (Encrypted Variables In A Plain File)


    Encrypting Sensitive Variables Inside Your Playbooks With An Encrypted String

    ANSIBLE VAULT: ENCRYPTED VARIABLE

    Use ansible-vault to create a new encrypted variable string.

    Ansible Terminal
    [ansible@redhat] $ ansible-vault encrypt_string 'Jumped The Shark' --name 'fonzie_stunt'
    
    		    

    Here are the pieces

    A breakdown of the command:

    Ansible Terminal
    ansible-vault
         encrypt_string 
             'this phrase will be encrypted' 
                 --name 'variable_name_of_encrypted_var'
    
    		    

    ANSIBLE VAULT: ENCRYPTED VARIABLE

    Use ansible-vault to create a new encrypted variable string.

    Ansible Terminal
    [ansible@redhat] $ ansible-vault encrypt_string 'Jumped The Shark' --name 'fonzie_stunt'
    New Vault password: fonzie
    Confirm New Vault password: fonzie
    
    fonzie_stunt: !vault |
              $ANSIBLE_VAULT;1.1;AES256
              35613061636564623138646464393731633534343261393532343263633763356364633366636633
              6430663339613762306235323035326663363665316234650a303434333462343731356632333136
              37393966336465386131666635333537636133313864383865303138303262343939326563373730
              3063376263303037340a356263333131626239316630653465313931353863623237666464613030
              37346537336430386265633239346566313466323764336234346361626666643334
    
    Encryption successful
    
    [ansible@redhat] $ 
    
    
    
    
    
    
    		    

    ANSIBLE VAULT: ENCRYPTED VARIABLE

    The pipe separates the multi-line value from the variable name.

    Ansible Terminal
    
    fonzie_stunt: !vault | 
        $ANSIBLE_VAULT;1.1;AES256
        35613061636564623138646464393731633534343261393532343263633763356364633366636633
        6430663339613762306235323035326663363665316234650a303434333462343731356632333136
        37393966336465386131666635333537636133313864383865303138303262343939326563373730
        3063376263303037340a356263333131626239316630653465313931353863623237666464613030
        37346537336430386265633239346566313466323764336234346361626666643334               
    
    
    		    

    ANSIBLE VAULT: ENCRYPTED VARIABLE

    Including an encrypted variable in a plaintext playbook.

    Ansible Terminal
    ---
    - hosts: localhost
      connection: local
      vars:
        fonzie_show: Happy Days
        fonzie_transport: Motorcycle
        fonzie_stunt: !vault |
            $ANSIBLE_VAULT;1.1;AES256
            35613061636564623138646464393731633534343261393532343263633763356364633366636633
            6430663339613762306235323035326663363665316234650a303434333462343731356632333136
            37393966336465386131666635333537636133313864383865303138303262343939326563373730
            3063376263303037340a356263333131626239316630653465313931353863623237666464613030
            37346537336430386265633239346566313466323764336234346361626666643334               
        fonzie_office: Mens room at Arnold's Diner
        fonzie_jacket: Leather
        fonzie_phrase: Aaaaaaayyyyyyyy
    
      tasks:
      - name: prove that we can read the variables within the encrypted string
        debug:
          msg: |
            Fonzie is a character from the TV show, {{ fonzie_show }}. He rides a {{ fonzie_transport }},
            wears a {{ fonzie_jacket }} jacket, and has an office in the {{ fonzie_office }}.
    
            Fonzie is most famous for his stunt where he {{ fonzie_stunt }}, after which,
            he said {{ fonzie_phrase }}!
    
    
    

    ANSIBLE VAULT: ENCRYPTED VARIABLE

    Including an encrypted variable in a plaintext playbook.

    Ansible Terminal
    ---
    - hosts: localhost
      connection: local
      vars:
        fonzie_show: Happy Days
        fonzie_transport: Motorcycle
        fonzie_stunt: !vault |                                                               
            $ANSIBLE_VAULT;1.1;AES256                                                        
            35613061636564623138646464393731633534343261393532343263633763356364633366636633 
            6430663339613762306235323035326663363665316234650a303434333462343731356632333136 
            37393966336465386131666635333537636133313864383865303138303262343939326563373730 
            3063376263303037340a356263333131626239316630653465313931353863623237666464613030 
            37346537336430386265633239346566313466323764336234346361626666643334                    
        fonzie_office: Mens room at Arnold's Diner
        fonzie_jacket: Leather
        fonzie_phrase: Aaaaaaayyyyyyyy
    
      tasks:
      - name: prove that we can read the variables within the encrypted string
        debug:
          msg: |
            Fonzie is a character from the TV show, {{ fonzie_show }}. He rides a {{ fonzie_transport }},
            wears a {{ fonzie_jacket }} jacket, and has an office in the {{ fonzie_office }}.
    
            Fonzie is most famous for his stunt where he {{ fonzie_stunt }}, after which,
            he said {{ fonzie_phrase }}!
    
    
    

    ANSIBLE VAULT: ENCRYPTED VARIABLE

    Including an encrypted variable in a plaintext playbook.

    Ansible Terminal
    
    [ansible@redhat] $ ansible-playbook --ask-vault-pass fonzie_playbook.yml 
    
    Vault password: 
    
    PLAY [localhost] *************************************************************************************************************
    
    TASK [Gathering Facts] *******************************************************************************************************
    ok: [localhost]
    
    TASK [prove that we can read the variable within the encrypted string] *******************************************************
    ok: [localhost] => {
        "msg": "Fonzie is a character from the TV show, Happy Days. He rides a Motorcycle,
        wears a Leather jacket, and has an office in the Mens room at Arnold's Diner.
        
        Fonzie is most famous for his stunt where he Jumped The Shark, after which, 
        he said Aaaaaaayyyyyyyy!"
    }
    
    PLAY RECAP *******************************************************************************************************************
    localhost                  : ok=2    changed=0    unreachable=0    failed=0   
    
    
    
    

    USING ROLES:

  • Improves readability and maintainability of complex plays
  • Eases sharing, reuse and standardization of automation processes
  • Enables Ansible content to exist independently of playbooks, projects -- even organizations
  • Provides functional conveniences such as file path resolution and default values
  • ROLES ANATOMY

    Ansible Terminal
    [ansible@redhat] $ tree example_role/
    
    example_role/
    ├── defaults
    │   └── main.yml
    ├── files
    ├── handlers
    │   └── main.yml
    ├── meta
    │   └── main.yml
    ├── README.md
    ├── tasks
    │   └── main.yml
    ├── templates
    ├── tests
    │   ├── inventory
    │   └── test.yml
    └── vars
        └── main.yml
    		

    MAIN ROLE DIRECTORY

    Ansible Terminal
    [ansible@redhat] $ tree example_role/
    
    example_role/
    ├── defaults
    │   └── main.yml
    ├── files
    ├── handlers
    │   └── main.yml
    ├── meta
    │   └── main.yml
    ├── README.md
    ├── tasks
    │   └── main.yml
    ├── templates
    ├── tests
    │   ├── inventory
    │   └── test.yml
    └── vars
        └── main.yml
    		

    DEFAULTS AND VARIABLES

    Ansible Terminal
    [ansible@redhat] $ tree example_role/
    
    example_role/
    ├── defaults
    │   └── main.yml
    ├── files
    ├── handlers
    │   └── main.yml
    ├── meta
    │   └── main.yml
    ├── README.md
    ├── tasks
    │   └── main.yml
    ├── templates
    ├── tests
    │   ├── inventory
    │   └── test.yml
    └── vars
        └── main.yml
    		

    FILES DIRECTORY

    Ansible Terminal
    [ansible@redhat] $ tree example_role/
    
    example_role/
    ├── defaults
    │   └── main.yml
    ├── files
    ├── handlers
    │   └── main.yml
    ├── meta
    │   └── main.yml
    ├── README.md
    ├── tasks
    │   └── main.yml
    ├── templates
    ├── tests
    │   ├── inventory
    │   └── test.yml
    └── vars
        └── main.yml
    		

    HANDLERS DIRECTORY

    Ansible Terminal
    [ansible@redhat] $ tree example_role/
    
    example_role/
    ├── defaults
    │   └── main.yml
    ├── files
    ├── handlers
    │   └── main.yml
    ├── meta
    │   └── main.yml
    ├── README.md
    ├── tasks
    │   └── main.yml
    ├── templates
    ├── tests
    │   ├── inventory
    │   └── test.yml
    └── vars
        └── main.yml
    		

    METADATA AND README

    Ansible Terminal
    [ansible@redhat] $ tree example_role/
    
    example_role/
    ├── defaults
    │   └── main.yml
    ├── files
    ├── handlers
    │   └── main.yml
    ├── meta
    │   └── main.yml
    ├── README.md
    ├── tasks
    │   └── main.yml
    ├── templates
    ├── tests
    │   ├── inventory
    │   └── test.yml
    └── vars
        └── main.yml
    		

    TASKS DIRECTORY

    Ansible Terminal
    [ansible@redhat] $ tree example_role/
    
    example_role/
    ├── defaults
    │   └── main.yml
    ├── files
    ├── handlers
    │   └── main.yml
    ├── meta
    │   └── main.yml
    ├── README.md
    ├── tasks
    │   └── main.yml
    ├── templates
    ├── tests
    │   ├── inventory
    │   └── test.yml
    └── vars
        └── main.yml
    		

    TEMPLATES DIRECTORY

    Ansible Terminal
    [ansible@redhat] $ tree example_role/
    
    example_role/
    ├── defaults
    │   └── main.yml
    ├── files
    ├── handlers
    │   └── main.yml
    ├── meta
    │   └── main.yml
    ├── README.md
    ├── tasks
    │   └── main.yml
    ├── templates
    ├── tests
    │   ├── inventory
    │   └── test.yml
    └── vars
        └── main.yml
    		

    TESTS DIRECTORY

    Ansible Terminal
    [ansible@redhat] $ tree example_role/
    
    example_role/
    ├── defaults
    │   └── main.yml
    ├── files
    ├── handlers
    │   └── main.yml
    ├── meta
    │   └── main.yml
    ├── README.md
    ├── tasks
    │   └── main.yml
    ├── templates
    ├── tests
    │   ├── inventory
    │   └── test.yml
    └── vars
        └── main.yml
    		

    INITIALIZING A ROLE

    ansible-galaxy command to init a new role:

    Ansible Terminal
    [ansible@redhat] $ ansible-galaxy init example_role
    
    - example_role was created successfully
    
    [ansible@redhat] $ 
    
    

    INTRODUCTION TO ROLES

    Project with Embedded Roles Example:

    Ansible Terminal
    [ansible@redhat] $ tree example_role/
    
    example_role/
    ├── defaults
    │   └── main.yml
    ├── files
    ├── handlers
    │   └── main.yml
    ├── meta
    │   └── main.yml
    ├── README.md
    ├── tasks
    │   └── main.yml
    ├── templates
    ├── tests
    │   ├── inventory
    │   └── test.yml
    └── vars
        └── main.yml
    
    
    
    

    INTRODUCTION TO ROLES

    Project with Embedded Roles Example:

    Ansible Terminal
    Some directories omitted for readability
    ├── site.yml
    └── roles
        ├── apache_role
        │   ├── defaults
        │   │   └── main.yml
        │   ├── files
        │   │   └── index.html
        │   ├── handlers 
        │   │   └── main.yml
        │   ├── tasks
        │   │   └── main.yml
        │   ├── templates
        │   │   └── http.conf.j2
        │   └── vars
        │       └── main.yml
        └── security_standards
            ├── defaults
            │   └── main.yml
            ├── files
            │   ├── sshd_conf
            │   └── sudoers
            ├── handlers
            │   └── main.yml
            ├── tasks
            │   └── main.yml
            ├── templates
            │   ├── etc_issue
            │   └── etc_motd
            └── vars
                └── main.yml    
    Some Interesting Files To Consider
    apache_role
        tasks/main.yml
        defaults/main.yml
        files/index.html
        templates/http.conf.j2
        vars/main.yml
     
    security_standards
        tasks/main.yml
        defaults/main.yml
        files/sshd_conf
        files/sudoers
        templates/etc_issue
        templates/etc_motd
        vars/main.yml
        

    PLAYBOOKS WITH ROLES

    See how simple it is to of a playbook with embedded roles.

    Ansible Terminal
    # site.yml
    ---
    - name: Apply some roles to our web servers
      hosts: web
      roles:
         - security_standards
         - apache_role
    
        

    SHARING YOUR CONTENT WITH OTHER TEAMS:

  • Publishing a catalog of roles
  • Creating best practices for use of roles
  • Roles as collaboration
  • Style guide
  • Code review
  • Galaxy or GIT?
  • requirements.yml and including roles
  • Ansible Galaxy

    http://galaxy.ansible.com

    Ansible Galaxy is a hub for finding, reusing and sharing Ansible content.

    Jump-start your automation project with content contributed and reviewed by the Ansible community.

    Next Steps

    • It's easy to get started
      ansible.com/get-started
    • Join the Ansible community
      ansible.com/community
    • Would you like to learn a lot more?
      redhat.com/en/services/training/do407-automation-ansible

    Thank you for attending

    Ansible Essentials Workshop