Skip to content

Support ansible-init for remote collections #411

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 34 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
dc6e27c
Add ansible-init role to requirements.yml
bertiethorpe Jul 16, 2024
4e09a6d
Add ansible-init to groups and plays
bertiethorpe Jul 17, 2024
fd023ec
Configure cluster_infra ansible-init metadata
bertiethorpe Jul 17, 2024
b6246c9
Only run site.yml once ansible-init has completed
bertiethorpe Jul 17, 2024
ec432d3
Wait for ansible init to finish before running bootstrap
bertiethorpe Jul 18, 2024
7ca2431
Merge branch 'main' into feat/linux-ansible-init
bertiethorpe Jul 18, 2024
1c8626e
revert to using cluster_infra metadata defaults
bertiethorpe Jul 19, 2024
21c6aac
update image
bertiethorpe Jul 19, 2024
cdb1593
revert sausage bastion changes
bertiethorpe Jul 19, 2024
78d8872
set ansible_init_wait as common var
bertiethorpe Jul 19, 2024
6ea5969
use run_number as a shorter ID for CI
bertiethorpe Jul 19, 2024
057c453
install ood apps in fatimage
bertiethorpe Jul 19, 2024
bb9609a
add ood jupyter install to fatimage
bertiethorpe Jul 22, 2024
fb2482a
bump image
bertiethorpe Jul 22, 2024
3547927
jupyter_compute ood into fatimage
bertiethorpe Jul 22, 2024
ec9c6a7
bump fatimage for jupyter_compute ood
bertiethorpe Jul 22, 2024
9ac18ef
Update stackhpc.yml
bertiethorpe Jul 22, 2024
bbf96ef
duplicate tuned inventory group name
bertiethorpe Jul 22, 2024
7ac8049
Fix invalid group name for slurmci
bertiethorpe Jul 22, 2024
e7bdbcc
Update stackhpc.yml
bertiethorpe Jul 22, 2024
aab9eab
slurmci group name warning
bertiethorpe Jul 23, 2024
f183a6a
rm ood changes
bertiethorpe Jul 23, 2024
8037c54
bump fatimage
bertiethorpe Jul 23, 2024
d021e56
put dashes in slurmci back
bertiethorpe Jul 23, 2024
8ff6d9e
Merge branch 'main' into feat/linux-ansible-init
bertiethorpe Jul 23, 2024
e4339bd
change azimuth collection in bootstrap
bertiethorpe Jul 25, 2024
d5e2c9e
Merge branch 'feat/linux-ansible-init' of github.com:stackhpc/ansible…
bertiethorpe Jul 25, 2024
627064a
update azimuth image utils version
bertiethorpe Jul 25, 2024
d0cdc2a
update requirements
bertiethorpe Jul 25, 2024
fb35fb2
Update bastion.yml
bertiethorpe Jul 25, 2024
24379c0
Merge branch 'main' into feat/linux-ansible-init
bertiethorpe Jul 25, 2024
1724bf8
Use azimuth image utils collection for ansible-init
bertiethorpe Jul 25, 2024
325c7b4
Merge branch 'feat/linux-ansible-init' of github.com:stackhpc/ansible…
bertiethorpe Jul 25, 2024
283ded6
bump fatimage
bertiethorpe Jul 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions ansible/bootstrap.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
---

- hosts: cluster
gather_facts: false
become: yes
tasks:
- name: Check if ansible-init is installed
stat:
path: /etc/systemd/system/ansible-init.service
register: _stat_ansible_init_unitfile

- name: Wait for ansible-init to finish
wait_for:
path: /var/lib/ansible-init.done
timeout: "{{ ansible_init_wait }}" # seconds
when: _stat_ansible_init_unitfile.stat.exists

- hosts: localhost
gather_facts: false
become: false
Expand Down Expand Up @@ -235,3 +250,11 @@
tasks:
- include_role:
name: ofed

- hosts: ansible_init
gather_facts: yes
become: yes
tags: linux_ansible_init
tasks:
- include_role:
name: azimuth_cloud.image_utils.linux_ansible_init
2 changes: 2 additions & 0 deletions ansible/fatimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,13 @@
tasks_from: install-package.yml
vars_from: "Rocky/{{ ansible_distribution_major_version }}.yml"
# # FUTURE: install-apps.yml - this is git clones

- name: Open Ondemand server (apps)
include_role:
name: osc.ood
tasks_from: install-apps.yml
vars_from: "Rocky/{{ ansible_distribution_major_version }}.yml"

- name: Open Ondemand remote desktop
import_role:
name: openondemand
Expand Down
2 changes: 2 additions & 0 deletions ansible/roles/cluster_infra/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ansible_init_collections: []
ansible_init_playbooks: []
51 changes: 51 additions & 0 deletions ansible/roles/cluster_infra/templates/resources.tf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,23 @@ resource "openstack_compute_instance_v2" "login" {
- "${openstack_compute_keypair_v2.cluster_keypair.public_key}"
{%- endif %}
EOF

metadata = {
{% for playbook in ansible_init_playbooks %}
ansible_init_pb_{{ loop.index0 }}_name = "{{ playbook.name }}"
{% if playbook.stage is defined %}
ansible_init_pb_{{ loop.index0 }}_stage = "{{ playbook.stage }}"
{% endif %}
{% endfor %}
{% for collection in ansible_init_collections %}
ansible_init_coll_{{ loop.index0 }}_name = "{{ collection.name }}"
ansible_init_coll_{{ loop.index0 }}_type = "{{ collection.type }}"
ansible_init_coll_{{ loop.index0 }}_version = "{{ collection.version }}"
{% if collection.source is defined %}
ansible_init_coll_{{ loop.index0 }}_source = "{{ collection.source }}"
{% endif %}
{% endfor %}
}
}

resource "openstack_compute_instance_v2" "control" {
Expand Down Expand Up @@ -446,6 +463,23 @@ resource "openstack_compute_instance_v2" "control" {
- [LABEL=home, /exports/home, auto]
{% endif %}
EOF

metadata = {
{% for playbook in ansible_init_playbooks %}
ansible_init_pb_{{ loop.index0 }}_name = "{{ playbook.name }}"
{% if playbook.stage is defined %}
ansible_init_pb_{{ loop.index0 }}_stage = "{{ playbook.stage }}"
{% endif %}
{% endfor %}
{% for collection in ansible_init_collections %}
ansible_init_coll_{{ loop.index0 }}_name = "{{ collection.name }}"
ansible_init_coll_{{ loop.index0 }}_type = "{{ collection.type }}"
ansible_init_coll_{{ loop.index0 }}_version = "{{ collection.version }}"
{% if collection.source is defined %}
ansible_init_coll_{{ loop.index0 }}_source = "{{ collection.source }}"
{% endif %}
{% endfor %}
}
}

{% for partition in openhpc_slurm_partitions %}
Expand Down Expand Up @@ -498,6 +532,23 @@ resource "openstack_compute_instance_v2" "{{ partition.name }}" {
- "${openstack_compute_keypair_v2.cluster_keypair.public_key}"
{%- endif %}
EOF

metadata = {
{% for playbook in ansible_init_playbooks %}
ansible_init_pb_{{ loop.index0 }}_name = "{{ playbook.name }}"
{% if playbook.stage is defined %}
ansible_init_pb_{{ loop.index0 }}_stage = "{{ playbook.stage }}"
{% endif %}
{% endfor %}
{% for collection in ansible_init_collections %}
ansible_init_coll_{{ loop.index0 }}_name = "{{ collection.name }}"
ansible_init_coll_{{ loop.index0 }}_type = "{{ collection.type }}"
ansible_init_coll_{{ loop.index0 }}_version = "{{ collection.version }}"
{% if collection.source is defined %}
ansible_init_coll_{{ loop.index0 }}_source = "{{ collection.source }}"
{% endif %}
{% endfor %}
}
}

{% endfor %}
Expand Down
6 changes: 3 additions & 3 deletions environments/.stackhpc/terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ variable "cluster_image" {
description = "single image for all cluster nodes, keyed by os_version - a convenience for CI"
type = map(string)
default = {
# https://github.com/stackhpc/ansible-slurm-appliance/pull/414
RL8: "openhpc-RL8-240723-0907-b560bf4c"
RL9: "openhpc-ofed-RL9-240723-0907-b560bf4c"
# https://github.com/stackhpc/ansible-slurm-appliance/pull/411
RL8: "openhpc-RL8-240725-1710-325c7b47"
RL9: "openhpc-ofed-RL9-240725-1710-325c7b47"
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ansible_init_wait: 1200 # seconds
3 changes: 3 additions & 0 deletions environments/common/inventory/groups
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,6 @@ freeipa_client

[tuned]
# Hosts to run TuneD configuration

[ansible_init]
# Hosts to run linux-anisble-init
4 changes: 4 additions & 0 deletions environments/common/layouts/everything
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,7 @@ openhpc

[tuned:children]
# Hosts to run TuneD configuration

[ansible_init:children]
# Hosts to run ansible-init
cluster
3 changes: 3 additions & 0 deletions requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,7 @@ collections:
- name: https://github.com/stackhpc/ansible-collection-terraform
type: git
version: 0.2.0
- name: https://github.com/azimuth-cloud/ansible-collection-image-utils
type: git
version: main # update on release
...
Loading