Skip to content
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

Remove some differences between fatimage and site #365

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
36 changes: 18 additions & 18 deletions ansible/fatimage.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
# Builder version of site.yml just installing binaries

- hosts: builder
become: no
gather_facts: no
tasks:
- name: Report hostname (= final image name)
command: hostname

- name: Run pre.yml hook
vars:
appliances_environment_root: "{{ lookup('env', 'APPLIANCES_ENVIRONMENT_ROOT') }}"
# hostvars not available here, so have to recalculate environment root:
appliances_environment_root: "{{ ansible_inventory_sources | last | dirname }}"
hook_path: "{{ appliances_environment_root }}/hooks/pre.yml"
import_playbook: "{{ hook_path if hook_path | exists else 'noop.yml' }}"
when: hook_path | exists

- import_playbook: validate.yml
when: appliances_validate | default(true)

- import_playbook: bootstrap.yml

- name: Run post-bootstrap.yml hook
vars:
appliances_environment_root: "{{ lookup('env', 'APPLIANCES_ENVIRONMENT_ROOT') }}"
# hostvars not available here, so have to recalculate environment root:
appliances_environment_root: "{{ ansible_inventory_sources | last | dirname }}"
hook_path: "{{ appliances_environment_root }}/hooks/post-bootstrap.yml"
import_playbook: "{{ hook_path if hook_path | exists else 'noop.yml' }}"
when: hook_path | exists
Expand All @@ -34,7 +32,7 @@
tasks_from: client-install.yml
when: "'freeipa_client' in group_names"

# - import_playbook: filesystems.yml:
# import_playbook: filesystems.yml:
- name: Install nfs packages
dnf:
name: nfs-utils
Expand All @@ -51,7 +49,7 @@
become: yes
gather_facts: yes
tasks:
# - import_playbook: slurm.yml:
# import_playbook: slurm.yml:
- name: Setup DB
include_role:
name: mysql
Expand All @@ -73,7 +71,7 @@
name: openondemand
tasks_from: vnc_compute.yml

# - import_playbook: monitoring.yml:
# import_playbook: monitoring.yml:
- import_role:
name: opensearch
tasks_from: install.yml
Expand Down Expand Up @@ -159,18 +157,20 @@

- name: Run post.yml hook
vars:
appliances_environment_root: "{{ lookup('env', 'APPLIANCES_ENVIRONMENT_ROOT') }}"
# hostvars not available here, so have to recalculate environment root:
appliances_environment_root: "{{ ansible_inventory_sources | last | dirname }}"
hook_path: "{{ appliances_environment_root }}/hooks/post.yml"
import_playbook: "{{ hook_path if hook_path | exists else 'noop.yml' }}"
when: hook_path | exists

- hosts: builder
become: yes
- name: Clean up and shutdown Packer VM
hosts: builder
gather_facts: no
become: yes
tasks:
# - meta: end_here
- name: Cleanup image
import_tasks: cleanup.yml

- name: Shutdown Packer VM
community.general.shutdown:
community.general.shutdown:

...
8 changes: 0 additions & 8 deletions ansible/site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,4 @@
import_playbook: "{{ hook_path if hook_path | exists else 'noop.yml' }}"
when: hook_path | exists

- name: Clean up and shutdown Packer VM
hosts: builder
gather_facts: no
become: yes
tasks:
- import_tasks: cleanup.yml
- community.general.shutdown:

...
7 changes: 7 additions & 0 deletions environments/.stackhpc/hooks/pre.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
- hosts: builder
become: no
gather_facts: no
tasks:
- name: Report hostname (= final image name)
command: hostname

- hosts: control:!builder
become: yes
gather_facts: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ opensearch_state: stopped # avoid writing config+certs+db into image
cuda_persistenced_state: stopped # probably don't have GPU in Packer build VMs
firewalld_enabled: false # dnf install of firewalld enables it
firewalld_state: stopped
appliances_validate: false
Loading