Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/theodrosyimer/ansible
Learning journey to master Ansible.
https://github.com/theodrosyimer/ansible
ansible lear learning-by-doing
Last synced: 23 days ago
JSON representation
Learning journey to master Ansible.
- Host: GitHub
- URL: https://github.com/theodrosyimer/ansible
- Owner: theodrosyimer
- Created: 2024-03-01T15:09:06.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-03-01T15:12:01.000Z (10 months ago)
- Last Synced: 2024-11-29T15:57:24.242Z (26 days ago)
- Topics: ansible, lear, learning-by-doing
- Language: Shell
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ansible commands
## Basics
execute on all hosts:
```sh
ansible-playbook -i inventory/file/path playbook/file/path
```## Gathering facts
for all hosts:
```sh
ansible -i inventory/file/path all -m setup
```for a single host:
```sh
ansible 192.168.1.20 -i inventory/file/path -m setup
```redirect the output to a file:
```sh
ansible -i inventory/file/path all -m setup > system_facts.txt
```these facts are stored in the `ansible_facts` variable and they are used, for example, in the `when` condition:
```yaml
- name: install apache
yum:
name: httpd
state: latest
when: ansible_facts['os_family'] == 'RedHat'
```README STILL IN PROGRESS...