{"id":415,"date":"2019-11-30T11:44:33","date_gmt":"2019-11-30T10:44:33","guid":{"rendered":"https:\/\/zed-network.fr\/?p=415"},"modified":"2020-08-24T19:16:23","modified_gmt":"2020-08-24T18:16:23","slug":"ansible-basic-commands","status":"publish","type":"post","link":"https:\/\/zed-network.fr\/?p=415","title":{"rendered":"How to Use Ansible: An Ansible Cheat Sheet"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Check hosts in the inventory :<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ansible@Deb-Master:~\/base$ ansible all --list-hosts\n   hosts (1):\n     client1<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Get list of modules <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ansible@Deb-Master:~\/base$ \/usr\/local\/bin\/ansible-doc -l | egrep ^(aci|mso)\n [WARNING]: win_template parsing did not produce documentation.\n [WARNING]: template parsing did not produce documentation.\n aci_l3out                                                     Manage Layer 3 Outside (L3Out) objects (l3ext:Out)\n aci_interface_policy_cdp                                      Manage CDP interface policies (cdp:IfPol)\n aci_maintenance_group_node                                    Manage maintenance group nodes\n mso_site                                                      Manage sites\n aci_intf_policy_fc                                            Manage Fibre Channel interface policies (fc:IfPol)\n aci_filter_entry                                              Manage filter entries (vz:Entry)\n mso_schema_site_vrf                                           Manage site-local VRFs in schema template\n mso_schema_site_anp_epg_staticleaf                            Manage site-local EPG static leafs in schema template\n aci_intf_policy_port_channel                                  Manage port channel interface policies (lacp:LagPol)\n mso_schema_template_filter_entry                              Manage filter entries in schema templates\n aci_aaa_user_certificate                                      Manage AAA user certificates (aaa:UserCert)\n aci_switch_policy_leaf_profile                                Manage switch policy leaf profiles (infra:NodeP)\n aci_interface_policy_lldp                                     Manage LLDP interface policies (lldp:IfPol)\n mso_schema_template_externalepg                               Manage external EPGs in schema templates\n aci_tenant_span_src_group                                     Manage SPAN source groups (span:SrcGrp)\n aci_access_port_block_to_access_port                          Manage port blocks of Fabric interface policy leaf profile interface selectors (infra:HPortS, infra:PortBlk)\n aci_epg_to_contract                                           Bind EPGs to Contracts (fv:RsCons, fv:RsProv)\n aci_access_port_to_interface_policy_leaf_profile              Manage Fabric interface policy leaf profile interface selectors (infra:HPortS, infra:RsAccBaseGrp, infra:PortBlk)\n aci_firmware_source                                           Manage firmware image sources (firmware:OSource)\n aci_tenant_action_rule_profile                                Manage action rule profiles (rtctrl:AttrP)\n[..]\n\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The documentation for a specific module<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ansible@Deb-Master:~\/base$ \/usr\/local\/bin\/ansible-doc  aci_tenant\n   ACI_TENANT (\/usr\/local\/lib\/python2.7\/dist-packages\/ansible\/modules\/network\/aci\/aci_tenant.py) \n    Manage tenants on Cisco ACI fabrics. \n This module is maintained by an Ansible Partner\n OPTIONS (= is mandatory):\n certificate_name\n     The X.509 certificate name attached to the APIC AAA user used for signature-based authentication.\n     If a private_key' filename was provided, this defaults to the private_key' basename, without extension.\n     If PEM-formatted content was provided for private_key', this defaults to the username' value.\n     (Aliases: cert_name)[Default: (null)]\n     type: str\n description\n     Description for the tenant.\n     (Aliases: descr)[Default: (null)]\n     type: str \n = host\n         IP Address or hostname of APIC resolvable by Ansible control host.\n         (Aliases: hostname)\n         type: str\n output_level\n     Influence the output of this ACI module.\n      normal' means the standard output, incl. current' dict\n      info' adds informational output, incl. previous', proposed' and sent' dicts\n     debug' adds debugging output, incl. filter_string', method',response', status' and url' information\n     (Choices: debug, info, normal)[Default: normal]\n     type: str \n[..]<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Check hosts in the inventory : ansible@Deb-Master:~\/base$ ansible all &#8211;list-hosts hosts (1): client1 Get list of modules ansible@Deb-Master:~\/base$ \/usr\/local\/bin\/ansible-doc -l | egrep ^(aci|mso) [WARNING]: win_template parsing did not produce documentation. [WARNING]: template parsing did not produce documentation. aci_l3out Manage Layer 3 Outside (L3Out) objects (l3ext:Out) aci_interface_policy_cdp Manage CDP interface policies (cdp:IfPol) aci_maintenance_group_node Manage maintenance group [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"footnotes":""},"categories":[28,27],"tags":[26,25],"class_list":["post-415","post","type-post","status-publish","format-standard","hentry","category-ansible","category-automation","tag-ansible","tag-automation"],"_links":{"self":[{"href":"https:\/\/zed-network.fr\/index.php?rest_route=\/wp\/v2\/posts\/415","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zed-network.fr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zed-network.fr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zed-network.fr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zed-network.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=415"}],"version-history":[{"count":6,"href":"https:\/\/zed-network.fr\/index.php?rest_route=\/wp\/v2\/posts\/415\/revisions"}],"predecessor-version":[{"id":545,"href":"https:\/\/zed-network.fr\/index.php?rest_route=\/wp\/v2\/posts\/415\/revisions\/545"}],"wp:attachment":[{"href":"https:\/\/zed-network.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=415"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zed-network.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=415"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zed-network.fr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=415"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}