Day 4 – Ansible Notes – Pep – Aug – 2023
Limited Time Offer!
For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!
PLAYBOOK/ROLES
Steps - https://www.devopsschool.com/blog/ansible-tower-workflow-tutorials/
Code - https://github.com/devopsschool-demo-labs-projects/ansible-hello-world-role
ansible-playbook -i inventory web.yaml -u user -k -b
=====================================================
Template
-i inventory == Inventory - DONE
web.yaml = Role === project - DONE
-u user -k == Authentication - DONE
-b = Authorization
37 ansible-vault
38 ansible-vault encrypt inventory
39 ls
40 more inventory
41 clear
42 ansible-vault edit inventory
43 more inventory
44 ansible-vault view inventory
45 ansible-vault decrypt inventory
46 more inventory
47 clear
48 ls
49 clear
50 ls
51 vi web.yaml
52 ls
53 clear
54 ls
55 vi inventory
56 ls
57 ansible-vault encrypt inventory
58 more inventory
59 clear
60 ls
61 ansible
62 ansible --version
63 ansible-playbook -i inventory web.yaml
64 ansible-playbook -i inventory web.yaml --ask-vault-pass
65 history
[root@localhost rajesh]# more web.yaml
---
- name: Install and configure web server
hosts: web
tasks:
- name: Copy file with owner and permissions
ansible.builtin.copy:
src: index.html
dest: /tmp/index.html