diff options
author | Dave Pigott <dave.pigott@linaro.org> | 2020-12-14 15:58:45 +0000 |
---|---|---|
committer | Dave Pigott <dave.pigott@linaro.org> | 2020-12-14 15:58:45 +0000 |
commit | 7a59ff00f8c32caebd4e8e99c5cf218f79455ada (patch) | |
tree | 90116aaca45eadd5d38d865fcb810fcfe4651509 | |
parent | 7fb784deef515201e06d3bb69eefd98ad69c60f7 (diff) |
Move over to single playbook for lava-lab
Change-Id: Ic302cd31257cdf4937d5572a0ff0ef53ef738bf8
29 files changed, 147 insertions, 215 deletions
diff --git a/ansible.cfg b/ansible.cfg index a761abb..66e98d9 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -12,7 +12,7 @@ # some basic default values... #hostfile = /etc/ansible/hosts -inventory = /srv/ansible-lab/inventory +inventory = /etc/ansible/inventory #library = /usr/share/ansible #remote_tmp = $HOME/.ansible/tmp #pattern = * diff --git a/inventory/ledge b/inventory/ledge index e33ff5d..5e9b153 100644 --- a/inventory/ledge +++ b/inventory/ledge @@ -9,3 +9,16 @@ ledge-master.ledgelab [ledge:children] ledge-dispatchers ledge-masters + +[workers] +ledge-dispatcher01.ledgelab +ledge-master.ledgelab + +[workers:vars] +instance_name=ledge.validation.linaro.org + +[masters] +ledge-master.ledgelab + +[masters:vars] +instance_name=lkft-staging.validation.linaro.org diff --git a/inventory/lkft b/inventory/lkft index 1fde422..771652c 100644 --- a/inventory/lkft +++ b/inventory/lkft @@ -36,3 +36,29 @@ lkft-dispatchers mlab-dispatchers lkft-masters +[masters] +lkft-master.lkftlab + +[masters:vars] +instance_name=lkft.validation.linaro.org + +[workers] +#lkft-qemu01.lkftlab +lkft-qemu02.lkftlab +lkft-qemu-arm01.lkftlab +#lkft-qemu-arm02.lkftlab +lkft-rpi-qemu01.lkftlab +lkft-rpi-qemu02.lkftlab +lkft-rpi-qemu03.lkftlab +lkft-rpi-qemu04.lkftlab +lkft-rpi-qemu05.lkftlab +lkft-rpi-qemu06.lkftlab +lkft-slave01.lkftlab +lkft-slave02.lkftlab +lkft-slave03.lkftlab +#lkft-slave04.lkftlab +lkft-slave05.lkftlab + +[workers:vars] +instance_name=lkft.validation.linaro.org + diff --git a/inventory/lkft-staging b/inventory/lkft-staging index 467144b..0847b0b 100644 --- a/inventory/lkft-staging +++ b/inventory/lkft-staging @@ -4,3 +4,17 @@ lkft-staging-rpi-01.lavalab [lkft-staging-masters] lkft-staging-master.lavalab + +[workers] +lkft-staging-qemu-arm01.lavalab +lkft-staging-rpi-01.lavalab + +[workers:vars] +instance_name=lkft-staging.validation.linaro.org + +[masters] +lkft-staging-master.lavalab + +[masters:vars] +instance_name=lkft-staging.validation.linaro.org + diff --git a/inventory/pmwg b/inventory/pmwg index ecea702..c7b2f12 100644 --- a/inventory/pmwg +++ b/inventory/pmwg @@ -11,3 +11,17 @@ pmwg-dispatcher01.pmwglab [pmwg:children] pmwg-master pmwg-dispatchers + +[masters] +pmwg-master.pmwglab + +[masters:vars] +instance_name=pmwg.validation.linaro.org + +[workers] +pmwg-master.pmwglab +pmwg-dispatcher01.pmwglab + +[workers:vars] +instance_name=pmwg.validation.linaro.org + diff --git a/inventory/staging b/inventory/staging index 72d254f..9d0305d 100644 --- a/inventory/staging +++ b/inventory/staging @@ -8,3 +8,19 @@ staging-m01.lavalab [staging:children] staging-master staging-dispatchers + +[masters] +staging-master.lavalab + +[masters:vars] +instance_name=staging.validation.linaro.org + +[workers] +staging01.lavalab +staging02.lavalab +staging03.lavalab +staging-m01.lavalab + +[workers:vars] +instance_name=staging.validation.linaro.org + diff --git a/inventory/tf b/inventory/tf index f9edaea..31ddf0b 100644 --- a/inventory/tf +++ b/inventory/tf @@ -10,3 +10,17 @@ tf-pi-worker01.tflab [tf:children] tf-masters tf-dispatchers + +[masters] +tf-master.tflab + +[masters:vars] +instance_name=tf.validation.linaro.org + +[workers] +tf-master.tflab +tf-pi-worker01.tflab + +[workers:vars] +instance_name=tf.validation.linaro.org + diff --git a/inventory/validation b/inventory/validation index 60dfe71..e139c8a 100644 --- a/inventory/validation +++ b/inventory/validation @@ -10,3 +10,24 @@ dispatcher-lite01.lavalab validation-master validation-dispatchers +[masters] +master.lavalab + +[masters:vars] +instance_name=validation.linaro.org + +[workers] +dispatcher01.lavalab +dispatcher02.lavalab +dispatcher03.lavalab +dispatcher04.lavalab +dispatcher05.lavalab +dispatcher-lite01.lavalab +pi-worker01.lavalab +pi-worker02.lavalab +pi-worker03.lavalab + +[workers:vars] +instance_name=validation.linaro.org + + diff --git a/playbooks/lava-lab.yml b/playbooks/lava-lab.yml new file mode 100644 index 0000000..5a2177a --- /dev/null +++ b/playbooks/lava-lab.yml @@ -0,0 +1,22 @@ +--- + +- hosts: workers + + roles: + - update-etc + +- hosts: masters + + roles: + - device-dicts + - device-types + - health-checks + +- hosts: + - workers + - masters + + roles: + - openssh + - lab-scripts + diff --git a/playbooks/master_config_ledge.yml b/playbooks/master_config_ledge.yml deleted file mode 100644 index da7a4f6..0000000 --- a/playbooks/master_config_ledge.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- - -- hosts: ledge-master.ledgelab - - vars: - instance_name: ledge.validation.linaro.org - - roles: - - device-dicts - - device-types - - health-checks - - openssh - - lab-scripts diff --git a/playbooks/master_config_lkft.yml b/playbooks/master_config_lkft.yml deleted file mode 100644 index c7f2b66..0000000 --- a/playbooks/master_config_lkft.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- - -- hosts: lkft-master.lkftlab - - vars: - instance_name: lkft.validation.linaro.org - - roles: - - device-dicts - - device-types - - health-checks - - openssh - - lab-scripts diff --git a/playbooks/master_config_lkft_staging.yml b/playbooks/master_config_lkft_staging.yml deleted file mode 100644 index e8548e2..0000000 --- a/playbooks/master_config_lkft_staging.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- - -- hosts: lkft-staging-master.lavalab - - vars: - instance_name: lkft-staging.validation.linaro.org - - roles: - - device-dicts - - device-types - - health-checks - - openssh - - lab-scripts diff --git a/playbooks/master_config_pmwg.yml b/playbooks/master_config_pmwg.yml deleted file mode 100644 index b5e447b..0000000 --- a/playbooks/master_config_pmwg.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- - -- hosts: pmwg-master.pmwglab - - vars: - instance_name: pmwg.validation.linaro.org - - roles: - - device-dicts - - device-types - - health-checks - - openssh - - lab-scripts diff --git a/playbooks/master_config_staging.yml b/playbooks/master_config_staging.yml deleted file mode 100644 index 6f96e83..0000000 --- a/playbooks/master_config_staging.yml +++ /dev/null @@ -1,12 +0,0 @@ ---- - -- hosts: staging-master.lavalab - - vars: - instance_name: staging.validation.linaro.org - - roles: - - device-dicts - - health-checks - - openssh - - lab-scripts diff --git a/playbooks/master_config_tf.yml b/playbooks/master_config_tf.yml deleted file mode 100644 index 83fc73d..0000000 --- a/playbooks/master_config_tf.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- - -- hosts: tf-master.tflab - - vars: - instance_name: tf.validation.linaro.org - - roles: - - device-dicts - - device-types - - health-checks - - openssh - - lab-scripts diff --git a/playbooks/master_config_vlo.yml b/playbooks/master_config_vlo.yml deleted file mode 100644 index 8686380..0000000 --- a/playbooks/master_config_vlo.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- - -- hosts: master.lavalab - - vars: - instance_name: validation.linaro.org - - roles: - - device-dicts - - device-types - - health-checks - - openssh - - lab-scripts diff --git a/playbooks/roles/device-dicts/tasks/main.yml b/playbooks/roles/device-dicts/tasks/main.yml index 4543fcd..6f6f9d0 100644 --- a/playbooks/roles/device-dicts/tasks/main.yml +++ b/playbooks/roles/device-dicts/tasks/main.yml @@ -1,5 +1,5 @@ --- -- name: Copy device dictionaries to {{ inventory_hostname }} +- name: Copy device dictionaries to {{ ansible_play_hosts }} copy: src: /srv/lava-lab/{{ instance_name }}/master-configs/{{ inventory_hostname }}/lava-server/dispatcher-config/devices/ dest: /etc/lava-server/dispatcher-config/devices/ diff --git a/playbooks/roles/device-types/tasks/main.yml b/playbooks/roles/device-types/tasks/main.yml index ce085f8..d47f366 100644 --- a/playbooks/roles/device-types/tasks/main.yml +++ b/playbooks/roles/device-types/tasks/main.yml @@ -1,5 +1,5 @@ --- -- name: Copy device types to {{ inventory_hostname }} +- name: Copy device types to {{ ansible_play_hosts }} copy: src: /srv/lava-lab/{{ instance_name }}/master-configs/{{ inventory_hostname }}/lava-server/dispatcher-config/device-types-extra/ dest: /etc/lava-server/dispatcher-config/device-types/ diff --git a/playbooks/roles/health-checks/tasks/main.yml b/playbooks/roles/health-checks/tasks/main.yml index 1194c2c..14ffd27 100644 --- a/playbooks/roles/health-checks/tasks/main.yml +++ b/playbooks/roles/health-checks/tasks/main.yml @@ -1,5 +1,5 @@ --- -- name: Copy health checks to {{ inventory_hostname }} +- name: Copy health checks to {{ ansible_play_hosts }} copy: src: /srv/lava-lab/{{ instance_name }}/master-configs/{{ inventory_hostname }}/lava-server/dispatcher-config/health-checks/ dest: /etc/lava-server/dispatcher-config/health-checks/ diff --git a/playbooks/roles/lab-scripts/tasks/main.yml b/playbooks/roles/lab-scripts/tasks/main.yml index 2c7ff32..555c087 100644 --- a/playbooks/roles/lab-scripts/tasks/main.yml +++ b/playbooks/roles/lab-scripts/tasks/main.yml @@ -1,5 +1,5 @@ --- -- name: Copy lab-scripts to {{ inventory_hostname }} +- name: Copy lab-scripts to {{ ansible_play_hosts }} copy: src: /srv/lava-lab/shared/lab-scripts/ dest: /usr/local/lab-scripts/ diff --git a/playbooks/roles/openssh/tasks/main.yml b/playbooks/roles/openssh/tasks/main.yml index 5b9b271..76477b1 100644 --- a/playbooks/roles/openssh/tasks/main.yml +++ b/playbooks/roles/openssh/tasks/main.yml @@ -1,5 +1,5 @@ --- -- name: Install openssh +- name: Install openssh on {{ ansible_play_hosts }} package: name: openssh-server state: present diff --git a/playbooks/roles/update-etc/tasks/main.yml b/playbooks/roles/update-etc/tasks/main.yml index 3070565..161e1da 100644 --- a/playbooks/roles/update-etc/tasks/main.yml +++ b/playbooks/roles/update-etc/tasks/main.yml @@ -1,5 +1,5 @@ --- -- name: Copy worker config to {{ inventory_hostname }} +- name: Copy worker config to {{ ansible_play_hosts }} copy: src: /srv/lava-lab/{{ instance_name }}/dispatcher-configs/{{ inventory_hostname }}/etc/ dest: /etc/ diff --git a/playbooks/worker_config_ledge.yml b/playbooks/worker_config_ledge.yml deleted file mode 100644 index fbbab51..0000000 --- a/playbooks/worker_config_ledge.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- - -- hosts: - - ledge-dispatcher01.ledgelab - - ledge-master.ledgelab - - vars: - instance_name: ledge.validation.linaro.org - - roles: - - update-etc - - openssh - - lab-scripts diff --git a/playbooks/worker_config_lkft.yml b/playbooks/worker_config_lkft.yml deleted file mode 100644 index 798ec48..0000000 --- a/playbooks/worker_config_lkft.yml +++ /dev/null @@ -1,30 +0,0 @@ ---- - -- hosts: -# - lkft-qemu01.lkftlab - - lkft-qemu02.lkftlab - - lkft-qemu-arm01.lkftlab -# - lkft-qemu-arm02.lkftlab - - lkft-rpi-qemu01.lkftlab - - lkft-rpi-qemu02.lkftlab - - lkft-rpi-qemu03.lkftlab - - lkft-rpi-qemu04.lkftlab - - lkft-rpi-qemu05.lkftlab - - lkft-rpi-qemu06.lkftlab - - lkft-slave01.lkftlab - - lkft-slave02.lkftlab - - lkft-slave03.lkftlab -# - lkft-slave04.lkftlab - - lkft-slave05.lkftlab - - lkft-slave06.lkftlab - - lkft-pi-worker01.lkftlab - - lkft-pi-worker02.lkftlab - - lkft-pi-worker03.lkftlab - - vars: - instance_name: lkft.validation.linaro.org - - roles: - - update-etc - - openssh - - lab-scripts diff --git a/playbooks/worker_config_lkft_staging.yml b/playbooks/worker_config_lkft_staging.yml deleted file mode 100644 index d153063..0000000 --- a/playbooks/worker_config_lkft_staging.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- - -- hosts: - - lkft-staging-master.lavalab - - lkft-staging-qemu-arm01.lavalab - - lkft-staging-rpi-01.lavalab - - vars: - instance_name: lkft-staging.validation.linaro.org - - roles: - - update-etc - - openssh - - lab-scripts diff --git a/playbooks/worker_config_pmwg.yml b/playbooks/worker_config_pmwg.yml deleted file mode 100644 index 6bceab2..0000000 --- a/playbooks/worker_config_pmwg.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- - -- hosts: - - pmwg-dispatcher01.pmwglab - - pmwg-master.pmwglab - - vars: - instance_name: pmwg.validation.linaro.org - - roles: - - update-etc - - openssh - - lab-scripts diff --git a/playbooks/worker_config_staging.yml b/playbooks/worker_config_staging.yml deleted file mode 100644 index a4549f7..0000000 --- a/playbooks/worker_config_staging.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- - -- hosts: - - staging01.lavalab - - staging02.lavalab - - staging03.lavalab - - staging-m01.lavalab - - vars: - instance_name: staging.validation.linaro.org - - roles: - - update-etc - - openssh - - lab-scripts diff --git a/playbooks/worker_config_tf.yml b/playbooks/worker_config_tf.yml deleted file mode 100644 index 303b449..0000000 --- a/playbooks/worker_config_tf.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- - -- hosts: - - tf-master.tflab - - tf-pi-worker01.tflab - - vars: - instance_name: tf.validation.linaro.org - - roles: - - update-etc - - openssh - - lab-scripts diff --git a/playbooks/worker_config_vlo.yml b/playbooks/worker_config_vlo.yml deleted file mode 100644 index 70655f5..0000000 --- a/playbooks/worker_config_vlo.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- - -- hosts: - - dispatcher01.lavalab - - dispatcher02.lavalab - - dispatcher03.lavalab - - dispatcher04.lavalab - - dispatcher05.lavalab - - dispatcher-lite01.lavalab - - pi-worker01.lavalab - - pi-worker02.lavalab - - pi-worker03.lavalab - - vars: - instance_name: validation.linaro.org - - roles: - - update-etc - - openssh - - lab-scripts |