DevOps Tools/Configuration/Ansible/Playbook Examples
From r00tedvw.com wiki
(Difference between revisions)
(Created page with "Overview | Continuous Integration (CI) | Source Control Management (SCM) | [[DevOps_Tools/Containerization|C...") |
|||
Line 2: | Line 2: | ||
[[DevOps_Tools/Configuration/Ansible|Ansible]] | [[DevOps_Tools/Configuration/Ansible/Playbook_Examples|Playbook Examples]] | [[DevOps_Tools/Configuration/Ansible|Ansible]] | [[DevOps_Tools/Configuration/Ansible/Playbook_Examples|Playbook Examples]] | ||
=[[DevOps_Tools/Configuration/Ansible/Playbook_Examples|Playbook Examples]]= | =[[DevOps_Tools/Configuration/Ansible/Playbook_Examples|Playbook Examples]]= | ||
+ | ==CentOS - ensure certain packages are installed== | ||
+ | This uses the '''yum''' module | ||
+ | <nowiki>~$ cat /etc/ansible/playbooks/centos_base_packages.yml | ||
+ | - hosts: centos | ||
+ | tasks: | ||
+ | - name: ensure a list of packages installed | ||
+ | yum: | ||
+ | name: "{{ packages }}" | ||
+ | vars: | ||
+ | packages: | ||
+ | - telnet | ||
+ | - net-tools | ||
+ | - vim | ||
+ | - tcpdump | ||
+ | - bind-utils | ||
+ | - redhat-lsb-core | ||
+ | - wget | ||
+ | - nfs-utils | ||
+ | - policycoreutils-python | ||
+ | - setroubleshoot | ||
+ | - setools | ||
+ | |||
+ | ~$ ansible-playbook /etc/ansible/playbooks/centos_base_packages.yml</nowiki> |
Revision as of 15:09, 31 January 2019
Overview | Continuous Integration (CI) | Source Control Management (SCM) | Containerization | Configuration | Integration
Ansible | Playbook Examples
Playbook Examples
CentOS - ensure certain packages are installed
This uses the yum module
~$ cat /etc/ansible/playbooks/centos_base_packages.yml - hosts: centos tasks: - name: ensure a list of packages installed yum: name: "{{ packages }}" vars: packages: - telnet - net-tools - vim - tcpdump - bind-utils - redhat-lsb-core - wget - nfs-utils - policycoreutils-python - setroubleshoot - setools ~$ ansible-playbook /etc/ansible/playbooks/centos_base_packages.yml