Difference between revisions of "Ansible playbooks examples"
Jump to navigation
Jump to search
Line 6: | Line 6: | ||
* <code>[[vars_files:]]</code> | * <code>[[vars_files:]]</code> | ||
+ | |||
+ | == Basic examples == | ||
+ | <pre> | ||
+ | #!/usr/bin/env ansible-playbook | ||
+ | |||
+ | - hosts: localhost | ||
+ | become: yes | ||
+ | |||
+ | tasks: | ||
+ | - package: | ||
+ | name: sysstat | ||
+ | state: present | ||
+ | </pre> | ||
== See also == | == See also == |
Revision as of 13:07, 15 December 2020
- Install and configure sysstat using Ansible (
package)
,lineinfile
,service
,Package:
) - Configure user to be able to use sudo with no password (
lineinfile
) ios_ping
Related terms
Basic examples
#!/usr/bin/env ansible-playbook - hosts: localhost become: yes tasks: - package: name: sysstat state: present
See also
- Ansible: modules, plugins, Playbooks (examples)
ansible-playbook
,ansible-vault
,ansible-inventory
,ansible-config
, Ansible Tower, Ansible Galaxy (Roles) (ansible-galaxy
),ansible-cmdb
,gather facts
,ansible.cfg
,Ansible Molecule
, Ansible collections,register
,template
,--ask-pass
,--ask-become-pass
,remote_user:
,/etc/ansible/hosts
,ansible-doc
,ansible-lint
,.ansible/
,--forks
,--start-at-task
,changelog
,inventory
,Notify:
,ansible HOSTNAME -m ping
,gathering
,/usr/bin/ansible
,ansible -m ping
,ansible.builtin
,hosts: (Ansible)
,set fact:
,when:
,blockinfile:
,become method:
,include:
,git:
, AWX,ansible --help
, Tags, Ansible variables, versions
Advertising: