ARTH Task 14

  • ansible.cfg — This file consists of the configuration, ansible will use while running playbook.
[defaults]
inventory = ./inventory.txt
host_key_checking = false
ask_pass = false
[privilege_escalation]
become = true
become_method = sudo
become_user = root
become_ask_pass = false
  • inventory.txt — This file consists of the hosts, on which playbook will run.
[web2]
ansiblemn2 ansible_ssh_user=root ansible_ssh_pass=1 ansible_connection=ssh
[docker]
  • task10-docker.yml — This file is the sample of my Arth Task10, as this Task 14 is the extended task of our Task 10.
  • docker.yml — This file will create docker repo, install it and start it. After then it will create docker container with some ports Exposed, and then main thing is, it will dynamically update my inventory file, so that the next playbook we run can be run without adding the hosts automatically.
  • web-docker.yml — This file is used to install httpd package, and start service and then create a page in that server.
ansible-playbook docker.yml
[web2]
ansiblemn2 ansible_ssh_user=root ansible_ssh_pass=1 ansible_connection=ssh
[docker]
172.17.0.2 ansible_ssh_user=root ansible_ssh_pass=root
ansible-playbook web-docker.yml
  • ansible.cfg — This file consists of the configuration, ansible will use while running playbook.
[defaults]
inventory = ./inventory.txt
host_key_checking = false
ask_pass = false
[privilege_escalation]
become = true
become_method = sudo
become_user = root
become_ask_pass = false
  • inventory.txt — This file consists of the hosts, on which playbook will run.
[web2]
ansiblemn2 ansible_ssh_user=root ansible_ssh_pass=1 ansible_connection=ssh
  • RedHatOS.yml — This file is a variable file, which contains variables of Packages and Services of Redhat OS.
  • UbuntuOS.yml — This file is a variable file, which contains variables of Packages and Services of Ubuntu OS.
  • playbook.yml — This file is the playbook which will fetch the OS Distribution Name, and according to that, packages of the particular OS will be installed and their respective services will be started.
ansible-playbook playbook.yml

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store