Oct. 26, 2023, 4 a.m. | technonotes-hacker

DEV Community dev.to




Playbook Using VARIABLES



  1. No special characters

  2. Avoid CAPS.

  3. '_' Allowed

  4. Case Sensitive

  5. DOT(.) not allowed



Make sure the Ansible Folders are outside the /etc





Using Variables - Installation of HTTPD & Firewalld




  • Create the yaml file with below details,



cat httpd.yml

---
- name: deploy and start httpd service
hosts: centos
become: true
vars:
web_pkg: httpd
firewall_pkg: firewalld
web_service: httpd
firewall_service: firewalld
rule: http

tasks:
- name: required packages installed and up to date
yum:
name:
- "{{ web_pkg }}" …

ansible become case characters deploy etc installation part service true variables yaml

Data Engineer

@ Lemon.io | Remote: Europe, LATAM, Canada, UK, Asia, Oceania

Artificial Intelligence – Bioinformatic Expert

@ University of Texas Medical Branch | Galveston, TX

Lead Developer (AI)

@ Cere Network | San Francisco, US

Research Engineer

@ Allora Labs | Remote

Ecosystem Manager

@ Allora Labs | Remote

Founding AI Engineer, Agents

@ Occam AI | New York