Skip to content

Commit

Permalink
Merge pull request #744 from IPvSean/gh-pages
Browse files Browse the repository at this point in the history
creating common framework for control node across all workshop varaints
  • Loading branch information
IPvSean authored Mar 21, 2020
2 parents a611bcc + 2f23753 commit 9b03ed2
Show file tree
Hide file tree
Showing 54 changed files with 495 additions and 447 deletions.
8 changes: 4 additions & 4 deletions exercises/ansible_f5/1.0-explore/README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ f5 ansible_host=34.199.128.69 ansible_user=admin private_ip=172.16.26.136 ansibl
[control]
ansible ansible_host=107.23.192.217 ansible_user=ec2-user private_ip=172.16.207.49
[webservers]
host1 ansible_host=107.22.141.4 ansible_user=ec2-user private_ip=172.16.170.190
host2 ansible_host=54.146.162.192 ansible_user=ec2-user private_ip=172.16.160.13
[web]
node1 ansible_host=107.22.141.4 ansible_user=ec2-user private_ip=172.16.170.190
node2 ansible_host=54.146.162.192 ansible_user=ec2-user private_ip=172.16.160.13
```

#### Step 5

上の出力では `[ ]` でグループを定義しています。例えば `[webservers]``host1``host2` を含んむグループです。
上の出力では `[ ]` でグループを定義しています。例えば `[web]``node1``node2` を含んむグループです。

> Note: **all** というグループは常に存在し、インベントリー内で定義された全てのホストとグループを含みます。
Expand Down
10 changes: 5 additions & 5 deletions exercises/ansible_f5/1.2-add-node/README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
password: "{{ansible_ssh_pass}}"
server_port: "8443"
validate_certs: "no"
loop: "{{ groups['webservers'] }}"
loop: "{{ groups['web'] }}"
```
{% endraw %}

Expand All @@ -81,9 +81,9 @@
- `password: "{{ansible_ssh_pass}}"` : BIG-IPへログインする際のパスワードを指定します。
- `server_port: 8443` : BIG-IPへ接続する際のポート番号を指定します。
- `host: "{{hostvars[item].ansible_host}}"` : モジュールへインベントリに登録済みのWebサーバーのIPアドレスを追加します。
- `name: "{{hostvars[item].inventory_hostname}}"` : `inventory_hostname` をホスト名(host1、host2 となります)として使うことを指示します。
- `name: "{{hostvars[item].inventory_hostname}}"` : `inventory_hostname` をホスト名(node1、node2 となります)として使うことを指示します。
- `validate_certs: "no"` : (あくまで演習用ラボなので)SSL証明書の検証を行わないように設定します。
- `loop:` : 与えられた一覧に対してタスクをループ実行することを指定します。この演習では、二つのRHELホストを含む webservers グループが一覧となります。
- `loop:` : 与えられた一覧に対してタスクをループ実行することを指定します。この演習では、二つのRHELホストを含む web グループが一覧となります。

## Step 4

Expand All @@ -103,8 +103,8 @@
PLAY [BIG-IP SETUP] ************************************************************
TASK [CREATE NODES] ************************************************************
changed: [f5] => (item=host1)
changed: [f5] => (item=host2)
changed: [f5] => (item=node1)
changed: [f5] => (item=node2)
PLAY RECAP *********************************************************************
f5 : ok=1 changed=1 unreachable=0 failed=0
Expand Down
10 changes: 5 additions & 5 deletions exercises/ansible_f5/1.2-add-node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Next, append the first `task` to above playbook. This task will use the `bigip_n
validate_certs: no
host: "{{hostvars[item].ansible_host}}"
name: "{{hostvars[item].inventory_hostname}}"
loop: "{{ groups['webservers'] }}"
loop: "{{ groups['web'] }}"
```
<!-- {% endraw %} -->

Expand All @@ -76,9 +76,9 @@ Next, append the first `task` to above playbook. This task will use the `bigip_n
- The `password: "{{ansible_ssh_pass}}"` parameter tells the module the password to login to the F5 BIG-IP device with
- The `server_port: 8443` parameter tells the module the port to connect to the F5 BIG-IP device with
- The `host: "{{hostvars[item].ansible_host}}"` parameter tells the module to add a web server IP address already defined in our inventory.
- The `name: "{{hostvars[item].inventory_hostname}}"` parameter tells the module to use the `inventory_hostname` as the name (which will be host1 and host2).
- The `name: "{{hostvars[item].inventory_hostname}}"` parameter tells the module to use the `inventory_hostname` as the name (which will be node1 and node2).
- The `validate_certs: "no"` parameter tells the module to not validate SSL certificates. This is just used for demonstration purposes since this is a lab.
- `loop:` tells the task to loop over the provided list. The list in this case is the group webservers which includes two RHEL hosts.
- `loop:` tells the task to loop over the provided list. The list in this case is the group web which includes two RHEL hosts.

Save the file and exit out of editor.

Expand All @@ -100,8 +100,8 @@ The output will look as follows.
PLAY [BIG-IP SETUP] ************************************************************
TASK [CREATE NODES] ************************************************************
changed: [f5] => (item=host1)
changed: [f5] => (item=host2)
changed: [f5] => (item=node1)
changed: [f5] => (item=node2)
PLAY RECAP *********************************************************************
f5 : ok=1 changed=1 unreachable=0 failed=0
Expand Down
2 changes: 1 addition & 1 deletion exercises/ansible_f5/1.2-add-node/bigip-node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
validate_certs: false
host: "{{hostvars[item].ansible_host}}"
name: "{{hostvars[item].inventory_hostname}}"
loop: "{{ groups['webservers'] }}"
loop: "{{ groups['web'] }}"
22 changes: 11 additions & 11 deletions exercises/ansible_f5/1.4-add-pool-members/README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
password: "{{ansible_ssh_pass}}"
server_port: "8443"
validate_certs: "no"
loop: "{{ groups['webservers'] }}"
loop: "{{ groups['web'] }}"
```
{% endraw %}

Expand All @@ -80,13 +80,13 @@
- `password: "{{ansible_ssh_pass}}"` : BIG-IPへログインする際のパスワードを指定します。
- `server_port: 8443` : BIG-IPへ接続する際のポート番号を指定します。
- `state: "present"` : プールメンバーを(削除ではなく)追加するように指定します。
- `name: "{{hostvars[item].inventory_hostname}}"` parameter tells the module to use the `inventory_hostname` as the name (which will be host1 and host2).
- `name: "{{hostvars[item].inventory_hostname}}"``inventory_hostname` をホスト名(host1、host2 となります)として使うことを指示します。
- `name: "{{hostvars[item].inventory_hostname}}"` parameter tells the module to use the `inventory_hostname` as the name (which will be node1 and node2).
- `name: "{{hostvars[item].inventory_hostname}}"``inventory_hostname` をホスト名(node1、node2 となります)として使うことを指示します。
- `host: "{{hostvars[item].ansible_host}}"` : モジュールへインベントリに登録済みのWebサーバーのIPアドレスを追加します。
- `pool: "http_pool"` : Webサーバーを追加するプールとして、http_pool を指定します。
- `validate_certs: "no"` : (あくまで演習用ラボなので)SSL証明書の検証を行わないように設定します。
最後に、(モジュール・パラメータではなく)タスクレベルのパラメータである、loop パラメータの指定です。
- `loop:` : 与えられた一覧に対してタスクをループ実行することを指定します。この演習では、二つのRHELホストを含む webservers グループが一覧となります。
- `loop:` : 与えられた一覧に対してタスクをループ実行することを指定します。この演習では、二つのRHELホストを含む web グループが一覧となります。

## Step 4

Expand All @@ -106,8 +106,8 @@
PLAY [BIG-IP SETUP] ************************************************************
TASK [ADD POOL MEMBERS] ********************************************************
changed: [f5] => (item=host1)
changed: [f5] => (item=host2)
changed: [f5] => (item=node1)
changed: [f5] => (item=node2)
PLAY RECAP *********************************************************************
f5 : ok=1 changed=1 unreachable=0 failed=0
Expand Down Expand Up @@ -173,11 +173,11 @@ TASK [Query BIG-IP facts] ******************************************************
changed: [f5]
TASK [Show members belonging to pool] ***********************************************************************************************************************
ok: [f5] => (item=host1:80) => {
"msg": "host1:80"
ok: [f5] => (item=node1:80) => {
"msg": "node1:80"
}
ok: [f5] => (item=host2:80) => {
"msg": "host2:80"
ok: [f5] => (item=node2:80) => {
"msg": "node2:80"
}
PLAY RECAP **************************************************************************************************************************************************
Expand Down Expand Up @@ -209,7 +209,7 @@ BIG-IP へのログイン情報:
- username: admin
- password: admin

プールに二つのメンバー(host1とhost2)が含まれていることを確認します。Local Traffic -> Pools とクリックします。そして、http_pool をクリックすることでより詳細な情報を確認します。Members タブをクリックすることで全てのプールメンバーが表示されます。
プールに二つのメンバー(node1とnode2)が含まれていることを確認します。Local Traffic -> Pools とクリックします。そして、http_pool をクリックすることでより詳細な情報を確認します。Members タブをクリックすることで全てのプールメンバーが表示されます。
![f5members](poolmembers.png)


Expand Down
4 changes: 2 additions & 2 deletions exercises/ansible_f5/1.4-add-pool-members/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Next, append the first `task` to above playbook. This task will use the `bigip_p
host: "{{hostvars[item].ansible_host}}"
port: "80"
pool: "http_pool"
loop: "{{ groups['webservers'] }}"
loop: "{{ groups['web'] }}"
```
{% endraw %}

Expand All @@ -87,7 +87,7 @@ Next we have module parameters
- The `pool: "http_pool"` parameter tells the module to put this node into a pool named http_pool
- The `validate_certs: "no"` parameter tells the module to not validate SSL certificates. This is just used for demonstration purposes since this is a lab.
Finally there is a loop parameter which is at the task level (it is not a module parameter but a task level parameter:
- `loop:` tells the task to loop over the provided list. The list in this case is the group webservers which includes two RHEL hosts.
- `loop:` tells the task to loop over the provided list. The list in this case is the group web which includes two RHEL hosts.

Save the file and exit out of editor.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
host: "{{hostvars[item].ansible_host}}"
port: "80"
pool: "http_pool"
loop: "{{ groups['webservers'] }}"
loop: "{{ groups['web'] }}"
8 changes: 4 additions & 4 deletions exercises/ansible_f5/1.5-add-virtual-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ Each RHEL web server actually already has apache running. Exercise 1.1 through

>This time use port 443 instead of 8443, e.g. https://X.X.X.X:443/

Each time you refresh the host will change between **host1** and **host2**. Here is animation of the host field changing:
Each time you refresh the host will change between **node1** and **node2**. Here is animation of the host field changing:
![animation](animation.gif)
>the animation might not work on certain browsers

Expand All @@ -149,11 +149,11 @@ Instead of using a browser window it is also possible to use the command line on

```
[studentX@ansible ~]$ curl https://172.16.26.136:443 --insecure --silent | grep studentX
<p>F5TEST-studentX-host1</p>
<p>F5TEST-studentX-node1</p>
[studentX@ansible ~]$ curl https://172.16.26.136:443 --insecure --silent | grep studentX
<p>F5TEST-studentX-host2</p>
<p>F5TEST-studentX-node2</p>
[studentX@ansible ~]$ curl https://172.16.26.136:443 --insecure --silent | grep studentX
<p>F5TEST-studentX-host1</p>
<p>F5TEST-studentX-node1</p>
```
Expand Down
2 changes: 1 addition & 1 deletion exercises/ansible_f5/1.6-add-irules/README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ when HTTP_REQUEST {
irules: ['irule1','irule2']
tasks:
- name: ADD iRules
bigip_irule:
provider:
Expand Down
2 changes: 1 addition & 1 deletion exercises/ansible_f5/1.6-add-irules/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ Next, append the `task` to above playbook. This task will use the `bigip_virtual
{% raw %}
``` yaml


- name: ATTACH iRules TO VIRTUAL SERVER
bigip_virtual_server:
provider:
Expand Down
16 changes: 8 additions & 8 deletions exercises/ansible_f5/2.0-disable-pool-member/README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,24 +173,24 @@ ok: [f5] => (item=None)
ok: [f5]

TASK [Show members belonging to pool http_pool] *************************************************************************************************************
ok: [f5] => (item=host1:80) => {
"msg": "host1:80"
ok: [f5] => (item=node1:80) => {
"msg": "node1:80"
}
ok: [f5] => (item=host2:80) => {
"msg": "host2:80"
ok: [f5] => (item=node2:80) => {
"msg": "node2:80"
}

TASK [pause] ************************************************************************************************************
[pause]
To disable a particular member enter member with format member_name:port
To disable all members of the pool enter 'all':
host1:80
node1:80

TASK [Disable ALL pool members] ************************************************************************************************************************
skipping: [f5] => (item=host1:80)
skipping: [f5] => (item=host2:80)
skipping: [f5] => (item=node1:80)
skipping: [f5] => (item=node2:80)

TASK [Disable pool member host1:80] *************************************************************************************************************************
TASK [Disable pool member node1:80] *************************************************************************************************************************
changed: [f5]

PLAY RECAP **************************************************************************************************************
Expand Down
4 changes: 2 additions & 2 deletions exercises/ansible_f5/2.1-delete-configuration/README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ TASK [DELETE POOL] *************************************************************
changed: [f5]

TASK [DELETE NODES] *************************************************************************************************************************************
changed: [f5] => (item=host1)
changed: [f5] => (item=host2)
changed: [f5] => (item=node1)
changed: [f5] => (item=node2)

PLAY RECAP **************************************************************************************************************************************
f5 : ok=4 changed=3 unreachable=0 failed=0
Expand Down
6 changes: 3 additions & 3 deletions exercises/ansible_f5/2.1-delete-configuration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ Finally, add the last `task` using the [bigip_node](https://docs.ansible.com/ans
provider: "{{provider}}"
name: "{{hostvars[item].inventory_hostname}}"
state: absent
loop: "{{ groups['webservers'] }}"
loop: "{{ groups['web'] }}"
```
{% endraw %}
The above playbook will delete the virtual server, then the pool and then the nodes configured in previous exercises.
Expand Down Expand Up @@ -181,8 +181,8 @@ TASK [DELETE POOL] *************************************************************
changed: [f5]

TASK [DELETE NODES] *************************************************************************************************************************************
changed: [f5] => (item=host1)
changed: [f5] => (item=host2)
changed: [f5] => (item=node1)
changed: [f5] => (item=node2)

PLAY RECAP **************************************************************************************************************************************
f5 : ok=4 changed=3 unreachable=0 failed=0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@
provider: "{{provider}}"
name: "{{hostvars[item].inventory_hostname}}"
state: absent
loop: "{{ groups['webservers'] }}"
loop: "{{ groups['web'] }}"
Loading

0 comments on commit 9b03ed2

Please sign in to comment.