-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add playbook pbench agent bootstrap and
pbench_agent install
- Loading branch information
Showing
6 changed files
with
148 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--- | ||
# | ||
# Playbook for installing pbench_bootstrap | ||
# | ||
# Usage: | ||
# ansible-playbook pbench_agent_bootstrap.yml -e "repos=<perf-dept-repo>" | ||
|
||
- hosts: compute | ||
tasks: | ||
- name: copy the keys | ||
shell: | | ||
sudo cp -r ~/.ssh /root/ | ||
- hosts: undercloud | ||
gather_facts: yes | ||
tasks: | ||
- name: clone perf-dept | ||
shell: | | ||
GIT_SSL_NO_VERIFY=true git clone {{ repos }} | ||
ignore_errors: yes | ||
|
||
- name: get computes ip | ||
shell: | | ||
source /home/stack/stackrc | ||
nova list | grep {{ item }} | cut -d \| -f 7 |cut -d \= -f 2 | awk '{$1=$1;print}' | ||
register: computes_ip | ||
with_items: | ||
- "{{ compute_names }}" | ||
|
||
- name: get floating ip of server and client | ||
shell: | | ||
source /home/stack/overcloudrc | ||
openstack server list | grep {{ item }} | cut -d \| -f 5 | cut -d \, -f 2 | awk '{$1=$1;print}' | ||
register: vms_fip | ||
with_items: | ||
- "{{ vm_names }}" | ||
shell: | | ||
sudo cp -r ~/.ssh /root/ | ||
- name: create inventories | ||
file: | ||
path: ~/.config/Inventories/ | ||
state: directory | ||
|
||
- name: generate a inventory | ||
template: | ||
src: repo_bootstrap.hosts.j2 | ||
dest: /home/stack/.config/Inventories/repo-bootstrap.hosts | ||
|
||
- name: run repo-bootstrap.yml | ||
shell: | | ||
ansible-playbook --user=root -i /home/stack/.config/Inventories/repo-bootstrap.hosts repo-bootstrap.yml | ||
register: repo_bootstrap | ||
args: | ||
chdir: /home/stack/perf-dept/sysadmin/Ansible | ||
- debug: | ||
msg: "{{ repo_bootstrap }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--- | ||
# | ||
# Playbook for pbench agent installations | ||
# Usage: | ||
# ansible-playbook pbench_agent_install.yml | ||
|
||
- hosts: compute | ||
gather_facts: yes | ||
tasks: | ||
- name: install perl-Data-UUID on Compute nodes | ||
shell: | | ||
sudo dnf install perl-Data-UUID -y | ||
- hosts: undercloud | ||
vars: | ||
pbench_agent_install: true | ||
|
||
tasks: | ||
- name: Install the pbench-agent roles from Galaxy | ||
shell: | | ||
ansible-galaxy collection install pbench.agent | ||
export ANSIBLE_ROLES_PATH=$HOME/.ansible/collections/ansible_collections/pbench/agent/roles:$ANSIBLE_ROLES_PATH | ||
- name: generate pbench agent playbook | ||
template: | ||
src: pbench_agent_install.yml.j2 | ||
dest: /home/stack/.ansible/collections/ansible_collections/pbench/agent/roles/pbench_agent_install.yml | ||
|
||
- name: get computes ip | ||
shell: | | ||
source /home/stack/stackrc | ||
nova list | grep {{ item }} | cut -d \| -f 7 |cut -d \= -f 2 | awk '{$1=$1;print}' | ||
register: computes_ip | ||
with_items: | ||
- "{{ compute_names }}" | ||
|
||
- name: get floating ip of server and client | ||
shell: | | ||
source /home/stack/overcloudrc | ||
openstack server list | grep {{ item }} | cut -d \| -f 5 | cut -d \, -f 2 | awk '{$1=$1;print}' | ||
register: vms_fip | ||
with_items: | ||
- "{{ vm_names }}" | ||
|
||
- name: create a inventory file | ||
template: | ||
src: repo_bootstrap.hosts.j2 | ||
dest: /home/stack/.config/myhosts.inv | ||
|
||
- name: run the playbook pbench_agent_install.yml | ||
shell: | | ||
ansible-playbook -i ~/.config/myhosts.inv pbench_agent_install.yml | ||
register: agent_install | ||
args: | ||
chdir: /home/stack/.ansible/collections/ansible_collections/pbench/agent/roles/ | ||
- debug: | ||
msg: "{{ agent_install }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters