You are here: Links of Interest » HEIG-VD » [CLD] Cloud Computing » Lab 07: Configuration Management
Lab 07: Configuration Management
This is an old revision of the document!
Table of Contents
Lab 07: Configuration Management
By Michaël Rohrer & Laureline David
Task 1: Install Ansible
DONE
Yoda:~ frederic$ ansible --version ansible 2.3.0.0 config file = configured module search path = Default w/o overrides python version = 2.7.13 (default, Apr 23 2017, 16:50:35) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)]
Task 2: Create a VM on Amazon Web Services
DONE
ssh -i id_rsa ubuntu@ec2-54-147-90-78.compute-1.amazonaws.com ... ubuntu@ip-172-31-38-253:~$
Task 3: Configure Ansible to connect to the managed VM
DONE
Yoda:playbooks frederic$ ansible testserver -i hosts -m ping Enter passphrase for key '/Users/frederic/.ssh/id_rsa': Enter passphrase for key '/Users/frederic/.ssh/id_rsa': testserver | SUCCESS => { "changed": false, "ping": "pong" }
Yoda:playbooks frederic$ ansible testserver -m ping Enter passphrase for key '/Users/frederic/.ssh/id_rsa': testserver | SUCCESS => { "changed": false, "ping": "pong" }
Yoda:playbooks frederic$ ansible testserver -m command -a uptime Enter passphrase for key '/Users/frederic/.ssh/id_rsa': testserver | SUCCESS | rc=0 >> 12:44:43 up 31 min, 2 users, load average: 0.00, 0.01, 0.05
Task 4: Install web application
DONE
Yoda:playbooks frederic$ ansible webservers -m ping Enter passphrase for key '/Users/frederic/.ssh/id_rsa': testserver | SUCCESS => { "changed": false, "ping": "pong" }
Yoda:playbooks frederic$ ansible-playbook web.yml PLAY [Configure webserver with nginx] ********************************************************************************************************************************************************************** TASK [Gathering Facts] ************************************************************************************************************************************************************************************* Enter passphrase for key '/Users/frederic/.ssh/id_rsa': ok: [testserver] TASK [install nginx] *************************************************************************************************************************************************************************************** changed: [testserver] TASK [copy nginx config file] ****************************************************************************************************************************************************************************** changed: [testserver] TASK [enable configuration] ******************************************************************************************************************************************************************************** ok: [testserver] TASK [copy index.html] ************************************************************************************************************************************************************************************* changed: [testserver] TASK [restart nginx] *************************************************************************************************************************************************************************************** changed: [testserver] PLAY RECAP ************************************************************************************************************************************************************************************************* testserver : ok=6 changed=4 unreachable=0 failed=0