Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/do-community/ansible-practice
Playbook examples to demonstrate basic concepts when writing Ansible playbooks.
https://github.com/do-community/ansible-practice
ansible ansible-playbook devops learning learning-by-doing
Last synced: about 8 hours ago
JSON representation
Playbook examples to demonstrate basic concepts when writing Ansible playbooks.
- Host: GitHub
- URL: https://github.com/do-community/ansible-practice
- Owner: do-community
- Created: 2021-03-11T17:12:39.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-10-25T11:24:55.000Z (about 2 years ago)
- Last Synced: 2023-02-28T05:17:22.318Z (over 1 year ago)
- Topics: ansible, ansible-playbook, devops, learning, learning-by-doing
- Language: HTML
- Homepage:
- Size: 382 KB
- Stars: 22
- Watchers: 6
- Forks: 31
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# How To Write Ansible Playbooks
This repository contains the examples and demos from the [How To Write Ansible Playbooks](https://www.digitalocean.com/community/tutorial_series/how-to-write-ansible-playbooks) Tutorial Series.
_Please notice that the playbooks in this repository are for demonstration and learning. They are not intended for production setups._
## Usage
To try these examples on your local Ansible setup, start by cloning this repository on your **Ansible Control Node**.
```command
git clone https://github.com/do-community/ansible-practice.git
cd ansible-practice
```Edit the included `inventory` file to include your remote node(s):
```command
nano inventory
``````ini
[dev]
203.0.113.10[all:vars]
ansible_python_interpreter=/usr/bin/python3
```Save and close the file.
You can run the playbooks with:
```command
ansible-playbook -i inventory playbook-01.yml -u REMOTE_USER
```If the playbook has a `become` directive it means you'll most probably will have to provide the `sudo` password for your connecting user. You dan do that by including the `-K` parameter:
```command
ansible-playbook -i inventory playbook-01.yml -u REMOTE_USER -K
```For more details, please refer to the tutorial series: [How To Write Ansible Playbooks](https://www.digitalocean.com/community/tutorial_series/how-to-write-ansible-playbooks).