Notes/docs/Command Snippets/Ansible Snippets.md
Keannu Bernasol 5646b45a5b vault backup: 2024-10-25 16:07:55
Affected files:
docs/Command Snippets/Ansible Snippets.md
2024-10-25 16:07:55 +08:00

24 lines
No EOL
477 B
Markdown

WSL Fix for world-writable directories
```bash
export ANSIBLE_CONFIG=./ansible.cfg
```
Ping
```bash
ansible all -m ping
```
Gather facts
```bash
ansible all -m gather_facts
# Limit to one device
ansible all -m gather_facts --limit ADDRESS
```
Elevate command to root user
```bash
# This will fail without sudo
ansible all -m apt -a update_cache=true
# This will succeed
# Equivalent to sudo apt-update
ansible all -m apt -a update_cache=true --become --ask-become-me-pass
```