Ansible - Section 0: Resources
ποΈ
β οΈ This guide assumes that you have python, docker, docker-compose, and ansible installed on your local machine. β οΈ
Table of Contents
π
- π home
- ποΈ resources
- π links
Description π
Resources for the Ansible
Zero to Pro Guide.
Helpful Content
π
This is a collection of helpful content for the Ansible
Zero to Pro Guide. It is not a part of Ansible
, but it is helpful for learning Ansible
.
Running in Docker-Compose π³π³
This will get you up and running with ansible. The below configuration will be starting up four docker containers
using fedora
as the base image with ansible installed.
-
Dockerfile
FROM fedora:latest RUN dnf -y install ansible; \ ansible-doc -t connection -l
-
docker-compose.yml
version: '3.9' services: target: &target tty: true scale: 4 build: context: . dockerfile: Dockerfile
-
.env
COMPOSE_PROJECT_NAME=ansible
Usage Steps π£
-
Build the containers
docker-compose build
-
Run the containers
docker-compose up -d
yml 
yml
is a human-readable data serialization language. It is commonly used for configuration files and in applications where data is being stored or transmitted. yml
is stored in key value pairs and can be used to serialize data structures such as maps, sequences, and scalars.
yml
Syntax
yml
is case sensitive- Comments are created using the # symbol
Examples π§©
-
key value pairs
Fruit: Apple Vegetable: Carrot Liquid: Water Meat: Chicken
-
arrays / lists
Fruits: - Orange - Apple - Banana Vegetables: - Carrot - Cauliflower - Tomato
-
dictionary / map
Banana: Calories: 105 Fat: 0.4g Carbs: 27g Grapes: Calories: 62 Fat: 0.3g Carbs: 16g
-
key value / dictionary / lists
Fruits: - Banana: Calories: 105 Fat: 0.4g Carbs: 27g - Grapes: Calories: 62 Fat: 0.3g Carbs: 16g
Notice the alignment, this is important in yml.
-
You can either set a value or a list/dictionary/map but not both
-
Dictionaries
are an unordered collection whilelists
are ordered
Useful Commands
in Fedora Β 
-
installs core utils
dnf install coreutils
-
installs proc utils
dnf install procutils
-
check what provides the
ps
commanddnf whatprovides ps
-
freebie, itβs
procps-ng
dnf install procps-ng
-