Ansible: Difference between revisions
Jump to navigation
Jump to search
Line 205: | Line 205: | ||
---- | ---- | ||
|- | |- | ||
| valign="top" | | | valign="top" colspan="3" | | ||
<source lang="bash"> | <source lang="bash"> | ||
pip install -r requirements.txt | pip install -r requirements.txt | ||
Line 211: | Line 211: | ||
</source> | </source> | ||
| valign="top" | | |- | ||
| colspan="3" | | |||
---- | |||
|- | |||
| valign="top"| | |||
<source lang="bash"> | <source lang="bash"> | ||
ansible-inventory -i inventory --list | |||
</source> | |||
| valign="top"| | |||
<source lang="bash"> | |||
ansible all -i inventory -m ping | |||
</source> | </source> | ||
| valign="top" | | | valign="top"| | ||
<source lang=" | <source lang="bash"> | ||
ansible-playbook -i inventory playbook.yml | |||
</source> | </source> | ||
Revision as of 10:41, 26 November 2022
sudo apt update && sudo apt list --upgradeable
sudo apt upgrade && sudo apt install ansible
ansible --version
Playbook
chorke-academia-project ├─ main_playbook.yml └─ inventories/ ├─ staging/ │ └─ academia/ │ ├─ group_vars/ │ │ ├─ all.yaml │ │ └─ academia_group.yaml │ └─ inventory.yml └─ test/ └─ academia/ ├─ group_vars/ │ ├─ all.yaml │ └─ academia_group.yaml └─ inventory.yml
Modules
Namespaces
| ||
Knowledge
python3 -m venv .venv --prompt="academia"
# source .venv/bin/activate
# (academia) $
|
python3 -m venv .venv --prompt="molecule"
# source .venv/bin/activate
# (molecule) $
|
python -m venv .venv --prompt="molecule"
# .venv\Scripts\activate
# (molecule) PS>
|
| ||
pip install -r requirements.txt
pip freeze > requirements.txt
| ||
| ||
ansible-inventory -i inventory --list
|
ansible all -i inventory -m ping
|
ansible-playbook -i inventory playbook.yml
|