ansible
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| ansible [2026/03/01 17:01] – [Playbooks] reddy | ansible [2026/03/01 19:14] (current) – reddy | ||
|---|---|---|---|
| Line 106: | Line 106: | ||
| name: httpd | name: httpd | ||
| state: latest | state: latest | ||
| + | |||
| + | - name: Task 2 | ||
| + | dnf: | ||
| + | name: | ||
| + | - net-tools | ||
| + | - bind-utils | ||
| + | - telnet | ||
| + | - nmap | ||
| + | - vim-enhanced | ||
| + | - sysstat | ||
| + | - tuned | ||
| + | - numactl | ||
| | | ||
| - name: Task 3 | - name: Task 3 | ||
| Line 158: | Line 170: | ||
| state: present | state: present | ||
| reload: true | reload: true | ||
| + | | ||
| + | - name: Task 8 | ||
| + | selinux: | ||
| + | policy: targeted | ||
| + | state: permissive | ||
| + | | ||
| + | - name: Task 8 | ||
| + | service: | ||
| + | name: firewalld | ||
| + | state: stopped | ||
| + | enabled: no | ||
| | | ||
| - name: Task 8 | - name: Task 8 | ||
| Line 182: | Line 205: | ||
| </ | </ | ||
| + | < | ||
| + | # Tasks to get the output from one command and use as conditional for another command | ||
| + | |||
| + | - name: Check ping | ||
| + | delegate_to: | ||
| + | shell: ping -c 1 somehost | ||
| + | register: reachableping | ||
| + | ignore_errors: | ||
| + | |||
| + | - name: Do something | ||
| + | delegate_to: | ||
| + | shell: ./run_cmd_1 | ||
| + | ignore_errors: | ||
| + | when: "' | ||
| + | </ | ||
| < | < | ||
| Line 203: | Line 241: | ||
| motd: "{{ motd }}" | motd: "{{ motd }}" | ||
| </ | </ | ||
| + | |||
| + | ===== Ansible Navigator ===== | ||
| + | |||
| + | Ansible Navigator uses podman to create an EE environment to run the Ansible playbooks and provides a text user interface to navigate through the documentation, | ||
| + | |||
| + | Install Ansible Navigator with: | ||
| + | |||
| + | < | ||
| + | pip3 install ansible-dev-tools ansible-navigator --user | ||
| + | |||
| + | # or | ||
| + | |||
| + | dnf install \ | ||
| + | --enablerepo=ansible-automation-platform-2.2-for-rhel-8-x86_64-rpms \ | ||
| + | ansible-navigator | ||
| + | </ | ||
| + | |||
| + | Use it with: | ||
| + | |||
| + | < | ||
| + | ansible-navigator run playbook1.yaml | ||
| + | |||
| + | ansible-navigator doc service | ||
| + | |||
| + | ansible-navigator doc service -m stdout | ||
| + | </ | ||
| + | |||
| + | ===== Common Ansible Problems ===== | ||
| + | |||
| + | < | ||
| + | ERROR: Ansible requires the locale encoding to be UTF-8; Detected ISO8859-1. | ||
| + | |||
| + | Set the following environment variables within the shell before running ansible / ansible-playbook | ||
| + | |||
| + | LANG=" | ||
| + | LC_CTYPE=" | ||
| + | </ | ||
| + | |||
| + | ===== Also See ===== | ||
| + | |||
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
ansible.1772380872.txt.gz · Last modified: by reddy
