Commit a06b33c7abef11c4b43881edef7763420ab80691

Authored by Lars Tiede
1 parent b47804ca

small stuff

Showing 2 changed files with 5 additions and 5 deletions   Show diff stats
@@ -70,7 +70,7 @@ Since Ansible uses SSH under the hood, and you very likely require root privileg @@ -70,7 +70,7 @@ Since Ansible uses SSH under the hood, and you very likely require root privileg
70 70
71 vagrant@demo-control:/vagrant$ ansible target1 -i inventory/demo -m shell -a "whoami" 71 vagrant@demo-control:/vagrant$ ansible target1 -i inventory/demo -m shell -a "whoami"
72 72
73 -There are two principle ways to become root with Ansible: Either SSH as root to the target (`-u root` will do this), or log in as whichever user and use sudo on the target (`--sudo`). In both cases, you have to be able to do the respective thing without password. There are options you can specify that lets Ansible ask you for a password, but that is really not recommended. 73 +There are two ways to become root with Ansible: Either SSH as root to the target (`-u root` will do this), or log in as whichever user and use sudo on the target (`--sudo`). In both cases, you have to be able to do the respective thing without password. There are options you can specify that lets Ansible ask you for a password, but that is really not recommended.
74 74
75 On our Vagrant boxes, passwordless SSH for the root user is not set up, but the 'vagrant' user can sudo without a password. So let's use sudo: 75 On our Vagrant boxes, passwordless SSH for the root user is not set up, but the 'vagrant' user can sudo without a password. So let's use sudo:
76 76
@@ -90,15 +90,15 @@ Note that we didn't say "install python-pip", but rather "have python-pip instal @@ -90,15 +90,15 @@ Note that we didn't say "install python-pip", but rather "have python-pip instal
90 If you want to break the rules, however, nothing stops you from running "apt-get install -y python-pip" with the "shell" module. 90 If you want to break the rules, however, nothing stops you from running "apt-get install -y python-pip" with the "shell" module.
91 91
92 92
93 -### 4. On second "concepts" slide: re-usable descriptions of small aspects of the system that you can combine in endless ways 93 +### 4. On second "abstractions" slide: make re-usable descriptions of small aspects of the system that you can combine in endless ways
94 94
95 -We have a minimal web app in the [webapp](webapp/) directory. We want to deploy this to two app servers (target1 and target2), and put them behind a simple load balancer on target1. 95 +We have a minimal web app in the [webapp](webapp/) directory. We want to deploy this to two app servers (target1 and target2), and put those behind a simple load balancer on target1.
96 96
97 The playbook in [deploy\_and\_run\_web\_app.yml](deploy_and_run_web_app.yml) does all of this. 97 The playbook in [deploy\_and\_run\_web\_app.yml](deploy_and_run_web_app.yml) does all of this.
98 98
99 -The playbook contains two 'plays', i.e., sequences of tasks and role invocations that are applied to a set of hosts. In the first play, the playbook sets up the web app instances on all hosts in the 'app\_servers' group (as defined in the [inventory file](inventory/demo)). To do this on each host, we have a role '[runs\_web\_app](roles/runs_web_app)'. In it, its sequence of tasks is (per convention) in [tasks/main.yml](roles/runs_web_app/tasks/main.yml). Files, templates and other role specific things can also be found in the role's directory. For this role, we just have one file in its 'files' subdirectory. Check out the Ansible documentation on [roles](http://docs.ansible.com/playbooks_roles.html#roles) for more details about what you can do with and inside roles. 99 +The playbook contains two 'plays', i.e., sequences of tasks and role invocations that are applied to a set of hosts. In the first play, the playbook sets up the web app instances on all hosts in the 'app\_servers' group (as defined in the [inventory file](inventory/demo)). To do this on each host, we have a role '[runs\_web\_app](roles/runs_web_app)'. In it, a sequence of tasks is (per convention) in [tasks/main.yml](roles/runs_web_app/tasks/main.yml). Files, templates and other role specific things can also be found in the role's directory. For this role, we just have one file in its 'files' subdirectory. Check out the Ansible documentation on [roles](http://docs.ansible.com/playbooks_roles.html#roles) for more details about what you can do with and inside roles. Roles are Ansible's main abstraction for making re-usable and shareable bits and pieces.
100 100
101 -The second play of the playbook sets up the load balancer on all hosts in the 'load\_balancer' group. In our inventory, that group contains only one host. For running a simple load balancer, we have the role '[runs\_simple\_load\_balancer](roles/runs_simple_load_balancer)'. This role can be configured a bit through variables that are passed into it on invocation: on which hosts and ports does the app run that should be load-balanced. There is a template in the role ([the nginx config file snippet](roles/runs_simple_load_balancer/templates/sites-enabled/webapp.j2)) that uses these variables. Variables can also be used nearly anywhere else outside of templates; think of most of the playbook text content as template-able content. Nearly everything is passed through the jinja2 templating engine that comes bundled with Ansible. Check the Ansible documentation on [variables and templating everywhere](http://docs.ansible.com/playbooks_variables.html#using-variables-about-jinja2) for more. 101 +The second play of the playbook sets up the load balancer on all hosts in the 'load\_balancer' group. In our inventory, that group contains only one host. For running a simple load balancer, we have the role '[runs\_simple\_load\_balancer](roles/runs_simple_load_balancer)'. This role can be configured a bit through variables that are passed into it on invocation: you can specify which hosts and ports the app servers that should be load-balanced run on. There is one template in the role ([the nginx config file snippet](roles/runs_simple_load_balancer/templates/sites-enabled/webapp.j2)) that uses these variables. Variables can also be used nearly anywhere else outside of templates; think of most of the playbook text content as template-able content. Nearly everything you write is (or can be) passed through the jinja2 templating engine that comes bundled with Ansible. Check the Ansible documentation on [variables and templating everywhere](http://docs.ansible.com/playbooks_variables.html#using-variables-about-jinja2) for more.
102 102
103 103
104 ### 5. Play! 104 ### 5. Play!
presentation.key
No preview for this file type