Skip to content

Commit

Permalink
Merge pull request #373 from ansible/devel
Browse files Browse the repository at this point in the history
Devel
  • Loading branch information
IPvSean authored Aug 13, 2019
2 parents a9b9a2b + cff9a1e commit 2c85b21
Show file tree
Hide file tree
Showing 35 changed files with 295 additions and 273 deletions.
47 changes: 12 additions & 35 deletions docs/setup.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# One Time Setup

Here are the setup directions you have to perform one time for the [../provisioner](provisioner).

# Table Of Contents

- [Setup](#setup)
- [Tower Instructions](#tower-instructions)

# Setup

1. Create an Amazon AWS account.

2. Create an Access Key ID and Secret Access Key. Save the ID and key for later.
Expand All @@ -21,11 +30,7 @@ aws_access_key_id = ABCDEFGHIJKLMNOP
aws_secret_access_key = ABCDEFGHIJKLMNOP/ABCDEFGHIJKLMNOP
```

5. Install the `passlib` library and `netaddr`

pip install passlib netaddr

6. Clone the workshops repo:
5. Clone the workshops repo:

If you haven't done so already make sure you have the repo cloned to the machine executing the playbook

Expand All @@ -38,7 +43,8 @@ If you haven't done so already make sure you have the repo cloned to the machine
- For F5 you will need the F5 BIG-IP [Click here](https://aws.amazon.com/marketplace/pp/B079C44MFH/)

# Tower Instructions
Are you using Red Hat Ansible Tower? Make sure to use umask for the installation of boto3 on the control node.

Are you using Red Hat Ansible Tower to provision Ansible Automation Workshops? (e.g. is your control node Ansible Tower?) Make sure to use umask for the installation of boto3 on the control node.
https://docs.ansible.com/ansible-tower/latest/html/upgrade-migration-guide/virtualenv.html

```
Expand All @@ -48,32 +54,3 @@ https://docs.ansible.com/ansible-tower/latest/html/upgrade-migration-guide/virtu
[root@centos ~]# pip install --upgrade boto3
[root@centos ~]# deactivate
```

# More info on what is happening

The `provision_lab.yml` playbook creates a work bench for each student, configures them for password authentication, and creates an inventory file for each user with their IPs and credentials. An instructor inventory file is also created in the current directory which will let the instructor access the nodes of any student. This file will be called `instructor_inventory.txt`

What does the AWS provisioner take care of automatically?
- AWS VPC creation (Amazon WebServices Virtual Private Cloud)
- Creation of an SSH key pair (stored at ./WORKSHOPNAME/WORKSHOPNAME-private.pem)
- Creation of a AWS EC2 security group
- Creation of a subnet for the VPC
- Creation of an internet gateway for the VPC
- Creation of route table for VPC (for reachability from internet)

# Webpage creation

If you used `create_login_page: true` above you will also get a webpage created for students.

The webpage will be generated as {{ec2_name_prefix}}.rhdemo.io
in the example above this literally means http://testworkshop.rhdemo.io

It is possible to change the route53 DNS as well using the parameter `workshop_dns_zone` in your `extra_vars.yml` file.

This playbook does not create the route53 zone and must exist prior to running the playbook.

# Remote Desktop

If you used `xrdp: true` you will the ability to remote desktop to the control node.

The provisioner has the ability to install [xrdp](http://www.xrdp.org/) with [xfce](https://xfce.org/) for graphical interface. The xrdp application is a an open source remote desktop protocol(rdp) server. Xfce is a lightweight desktop environment for UNIX-like operating systems. It aims to be fast and low on system resources, while still being visually appealing and user friendly.
25 changes: 13 additions & 12 deletions exercises/ansible_f5/2.0-disable-pool-member/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@ Demonstrate the removal of a node from the pool. Build a Playbook that:

Using your text editor of choice create a new file called `disable-pool-member.yml`.

{% raw %}
<!-- {% raw %} -->
```
[student1@ansible ~]$ nano disable-pool-member.yml
```
{% endraw %}
<!-- {% endraw %} -->

>`vim` and `nano` are available on the control node, as well as Visual Studio and Atom via RDP
## Step 2:

Enter the following play definition into `disable-pool-member.yml`:

{% raw %}
<!-- {% raw %} -->
``` yaml
---

Expand All @@ -49,13 +49,13 @@ Enter the following play definition into `disable-pool-member.yml`:
gather_facts: false

```
{% endraw %}
<!-- {% endraw %} -->

## Step 3

Add a tasks section and then set a fact for the provider. Once you set the provider you can re-use this key in future tasks instead of giving the server/user/password/server_port and validate_certs info to each task.

{% raw %}
<!-- {% raw %} -->
```
---
- name: "Disabling a pool member"
Expand All @@ -73,19 +73,18 @@ Add a tasks section and then set a fact for the provider. Once you set the provi
server_port: "8443"
validate_certs: "no"
```
{% endraw %}
<!-- {% endraw %} -->

Now in the next task you can use provider as follows:

{% raw %}

<!-- {% raw %} -->
```
bigip_device_facts:
provider: "{{provider}}"
gather-subset:
- ltm-pools
```
{% endraw %}
<!-- {% endraw %} -->

You DO NOT need to pass the server_ip/user/password etc. for each module going forward

Expand All @@ -95,6 +94,7 @@ You DO NOT need to pass the server_ip/user/password etc. for each module going f
hosts: lb
gather_facts: false
connection: local
```

Next, add a task for the objective listed below:

Expand Down Expand Up @@ -143,7 +143,7 @@ Next, add a task for the objective listed below:
- Read the prompt information and disable all members or a single member based on the input from the user

HINT:
Remember to use <a href="https://docs.ansible.com/ansible/latest/user_guide/playbooks_conditionals.html" style="color: #000000"> when conditions and loops </a></span> and [BIG-IP pool member module](https://docs.ansible.com/ansible/latest/modules/bigip_pool_member_module.html)
Remember to use <a href="https://docs.ansible.com/ansible/latest/user_guide/playbooks_conditionals.html" style="color: #000000"> when conditions and loops</a> and [BIG-IP pool member module](https://docs.ansible.com/ansible/latest/modules/bigip_pool_member_module.html)

## Step 10
Run the playbook - exit back into the command line of the control host and execute the following:
Expand All @@ -156,7 +156,7 @@ Run the playbook - exit back into the command line of the control host and execu

The output will look as follows.

{% raw %}
<!-- {% raw %} -->
```yaml
[student1@ansible ~]$ ansible-playbook disable-pool-member.yml

Expand Down Expand Up @@ -201,7 +201,8 @@ changed: [f5]
PLAY RECAP **************************************************************************************************************
f5 : ok=7 changed=2 unreachable=0 failed=0
```
{% endraw %}
<!-- {% endraw %} -->
# Solution
The solution will be provided by the instructor if you are stuck. The GUI should show something similar to the following with a black diamond indicating the specified node was forced offline.
Expand Down
2 changes: 1 addition & 1 deletion exercises/ansible_network/5-explore-tower/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Open up your web browser and type in the Ansible control node's DNS name
After logging in the Job Dashboard will be the default view as shown below.
![Tower Job Dashboard](images/tower_login.png)

1. Click on the **i** information button on the top left of the user interface.
1. Click on the **i** information button on the top right of the user interface.

![information button link](images/information_button.png)

Expand Down
2 changes: 1 addition & 1 deletion exercises/ansible_network/7-tower-survey/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Demonstrate the use of Ansible Tower [survey feature](https://docs.ansible.com/a

| Parameter | Value |
|---|---|
| Name | CONFIGURE BANNER |
| Name | Network-Banner |
| Job Type | Run |
| Inventory | Workshop Inventory |
| Project | Workshop Project |
Expand Down
Binary file modified exercises/ansible_network/7-tower-survey/images/survey.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion exercises/ansible_network/8-tower-rbac/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ For more in depth details on RBAC terminology please refer to the [documentation

![permissions window](images/RBAC_9.png )

Note the **TEAM ROLES** assigned for the **network-admin** and **network-operator** users. By assigning the **USE** Role, these users have been granted permission to use this particular inventory:
Note the **TEAM ROLES** assigned for the **network-admin** and **network-operator** users. By assigning the **USE** Role, the **network-operator** user has been granted permission to use this particular inventory.

## Step 7: Job Template Permissions

Expand Down
Binary file modified exercises/ansible_network/8-tower-rbac/images/RBAC_9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 16 additions & 14 deletions exercises/ansible_network/9-tower-workflow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
- [Guide](#guide)
- [Step 1: Create a Job Template](#step-1-create-a-job-template)
- [Step 2: The Workflow Visualizer](#step-2-the-workflow-visualizer)
- [Step 3: Add the Backup Job Template](#step-3-add-the-backup-job template)
- [Step 4: Add the Configure Banner Job Template](#Step 4-add-the-configure-banner-job-template)
- [Step 5: Add the Restore Job Template](#step-5-add-the-restore-job-template)
- [Step 3: Add the Configure Banner Job Template](#step-3-add-the-configure-banner-job-template)
- [Step 4: Add the Configure Network-User Job Template](#step-4-add-the-configure-network-user-job-template)
- [Step 5: Add the Network-Restore Job Template](#step-5-add-the-network-restore-job-template)
- [Step 6: Create a converged link](#step-6-create-a-converged-link)
- [Step 7: Run the Workflow](#step-7-run-the-workflow)
- [Takeaways](#takeaways)
Expand All @@ -23,19 +23,21 @@ For this exercise we will create a time-stamped backup, if the backup job succes

## Step 1: Create a Job Template

1. Click on the **Templates** link on the left menu.
1. Make sure you are logged in as the **admin** user.

2. Click on the green **+** button. Select the **Workflow Template**.
2. Click on the **Templates** link on the left menu.

3. Fill out the the form as follows:
3. Click on the green **+** button. Select the **Workflow Template**.

4. Fill out the the form as follows:

| Parameter | Value |
|---|---|
| Name | Workshop Workflow |
| Organization | Default |
| Inventory | Workshop Inventory |

4. Click on the **Save** button
5. Click on the **Save** button

![workflow creation](images/workflow_create.gif)

Expand All @@ -49,13 +51,13 @@ For this exercise we will create a time-stamped backup, if the backup job succes

![add a template](images/add-a-template.png)

The `Backup` job template is now a node. Job or workflow templates are linked together using a graph-like structure called nodes. These nodes can be jobs, project syncs, or inventory syncs. A template can be part of different workflows or used multiple times in the same workflow. A copy of the graph structure is saved to a workflow job when you launch the workflow.
The `Backup network configurations` job template is now a node. Job or workflow templates are linked together using a graph-like structure called nodes. These nodes can be jobs, project syncs, or inventory syncs. A template can be part of different workflows or used multiple times in the same workflow. A copy of the graph structure is saved to a workflow job when you launch the workflow.

![configure backup node](images/configure-backup.png)

## Step 3: Add the Backup Job Template
## Step 3: Add the Configure Banner Job Template

1. Hover over the *Backup* node and click the green **+** symbol. The **ADD A TEMPLATE** window will appear again.
1. Hover over the *Backup network configurations* node and click the green **+** symbol. The **ADD A TEMPLATE** window will appear again.

2. Select the **Configure Banner** Job Template. For the **Run** parameter select **On Success** from the drop down menu.

Expand All @@ -65,7 +67,7 @@ For this exercise we will create a time-stamped backup, if the backup job succes

![banner node](images/configure-banner.png)

## Step 4: Add the Configure Banner Job Template
## Step 4: Add the Configure Network-User Job Template

1. Hover over the *Backup* node (not the **Configure Banner** node) and click the green **+** symbol. The **ADD A TEMPLATE** will appear again.

Expand All @@ -74,19 +76,19 @@ For this exercise we will create a time-stamped backup, if the backup job succes
![configure user node](images/configure-user.png)


## Step 5: Add the Restore Job Template
## Step 5: Add the Network-Restore Job Template

1. Hover over the **Configure Banner** node and click the green **+** symbol. The **ADD A TEMPLATE** will appear again.

2. Select the **Restore Network Config** job template. For the **Run** parameter select **On Failure** from the drop down menu.
2. Select the **Network-Restore** job template. For the **Run** parameter select **On Failure** from the drop down menu.

![configure restore node](images/configure-restore.png)

## Step 6: Create a converged link

1. Hover over the **Network-User** node and click the blue **chain** symbol.

2. Now, click on the existing **Restore Network Config**. A **ADD LINK** window will appear. For the **RUN** parameter choose **On Failure**.
2. Now, click on the existing **Network-Restore**. A **ADD LINK** window will appear. For the **RUN** parameter choose **On Failure**.

![restore node](images/completed-workflow.png)

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion exercises/ansible_network/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This content is a multi-purpose toolkit for effectively demonstrating Ansible's

## Presentation
Want the Presentation Deck? Its right here:
[Ansible Network Automation Workshop Deck](https://ansible.github.io/linklight/decks/ansible_network.pdf)
[Ansible Network Automation Workshop Deck](https://ansible.github.io/workshops/decks/ansible_network.pdf)

## Ansible Network Automation Exercises

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ Our next step is to use the template module to generate a report from the above

> Note: For this lab the Jinja2 template has been pre-populated for you. Feel free to look at the file **interface_facts.j2** in the **templates** directory.

> Note: The debug task has been commented out so that display is consise
> Note: The debug task has been commented out so that display is concise

#### Step 9

Expand Down
4 changes: 2 additions & 2 deletions exercises/ansible_rhel/1.1-setup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ Log out of the root account again:

You might have guessed by now this lab is pretty commandline-centric…​ :-)

- Don’t type everything manually, use copy & paste from the browser when appropriate. But don’t stop to think and understand.
- Don’t type everything manually, use copy & paste from the browser when appropriate. But stop to think and understand.

- All labs where prepared using **Vim**, but we understand not everybody loves it. Feel free to use alternative editors, in the lab environment we provide **Midnight Commander** (just run **mc**, function keys can be reached via Esc-\<n\> or simply clicked with the mouse) or **Nano** (run **nano**). Here is a short [editor intro](../0.0-support-docs/editor_intro.md).
- All labs were prepared using **Vim**, but we understand not everybody loves it. Feel free to use alternative editors. In the lab environment we provide **Midnight Commander** (just run **mc**, function keys can be reached via Esc-\<n\> or simply clicked with the mouse) or **Nano** (run **nano**). Here is a short [editor intro](../0.0-support-docs/editor_intro.md).

> **Tip**
>
Expand Down
Loading

0 comments on commit 2c85b21

Please sign in to comment.