Difference between revisions of "Ansible modules"
Jump to navigation
Jump to search
↑ https://docs.ansible.com/ansible/latest/modules/modules_by_category.html
↑ https://docs.ansible.com/ansible/latest/modules/setup_module.html
↑ https://www.unixarena.com/2018/07/ansible-command-vs-shell-vs-raw-modules.html/
↑ https://docs.ansible.com/ansible/2.6/modules/docker_module.html
↑ https://docs.ansible.com/ansible/latest/modules/docker_compose_module.html
↑ https://medium.com/@tcij1013/ten-useful-ansible-modules-83fb6fb2d45e
Line 37: | Line 37: | ||
* <code>[[boto3 required for this module]]</code> | * <code>[[boto3 required for this module]]</code> | ||
* <code>[[copy (Windows)]]</code> | * <code>[[copy (Windows)]]</code> | ||
+ | * <code>[[amazon.aws]]</code> | ||
== See also == | == See also == |
Revision as of 13:53, 17 January 2023
Ansible modules[1] add new capabilities to Ansible and is a core component of the software, as of September 2019 there are more than 2.800 modules available: ansible-doc --list
. For example you can manage AWS infrastructure using Ansible, execute commands with shell
module or collect information using setup
[2] module.
ansible -m setup SERVER_NAME
will collect information from your systemansible -m setup SERVER_NAME -a 'filter=ansible_distribution'
. Collect just OS.
Modules
apt_repository
: Ansible playbook: Add a repositorydocker compose
: New in version 2.1 and was call docker_service before Ansible 2.8docker_container
: New in version 2.1file
, for managing files and directories: https://docs.ansible.com/ansible/latest/modules/file_module.htmlovirt_vm
(KVM)
- Execution modules:
gather_facts
,lineinfile
,package
,[[user:]]
,group
,mount
,git
,docker
[4],docker_compose
[5] andmail
modules, [6] see all of them by category: https://docs.ansible.com/ansible/latest/modules/modules_by_category.html
package:
apt:
- service:
- Ansible module: archive
community.general.filesystem
community.general.postgresql_db_module
Examples of Ansible execution modules
ansible -m raw DESTINATION_HOSTNAME -a uptime
ansible -m shell DESTINATION_HOSTNAME -a uptime
ansible -m command DESTINATION_HOSTNAME -a uptime
(Do not support some characters as: "|")
Related terms
- Terraform modules
- Ansible plugins
ansible-galaxy collection install
boto3 required for this module
copy (Windows)
amazon.aws
See also
- Ansible modules:
gather_facts, set_fact
,ansible.builtin.file
,lineinfile
,stat
,group
,mount
,git:
,package:
,command:
,shell:
,raw:
,template:
,register:
,user:
, Ansible playbooks examples,tasks:
,lineinfile, blockinfile:
,shell:
,command:
,raw:
,ansible.builtin.file, service:, aws.ecs_taskdefinition, aws.asg, docker_container, kubernetes.core.k8s
,community.
,include_tasks
Advertising: