Skip to content

Commit

Permalink
remove some differences bewteen fatimage.yml and site.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
sjpb committed Feb 22, 2024
1 parent 8b52efc commit a792787
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
33 changes: 20 additions & 13 deletions ansible/fatimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@

- 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 @@ -20,14 +25,14 @@
become: yes
gather_facts: no
tasks:
# - import_playbook: iam.yml
# import_playbook: iam.yml:
- name: Install FreeIPA client
import_role:
name: freeipa
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 @@ -44,7 +49,7 @@
become: yes
gather_facts: no
tasks:
# - import_playbook: slurm.yml:
# import_playbook: slurm.yml:
- name: Setup DB
include_role:
name: mysql
Expand All @@ -58,7 +63,7 @@
include_vars: "{{ appliances_repository_root }}/ansible/roles/osc.ood/vars/Rocky/8.yml"
# FUTURE: install-apps.yml - this is git clones

# - import_playbook: portal.yml
# import_playbook: portal.yml
- name: Open Ondemand server
import_role:
name: osc.ood
Expand All @@ -68,7 +73,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 @@ -154,18 +159,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:

...
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 # dnf install of firewalld enables it
appliances_validate: false

0 comments on commit a792787

Please sign in to comment.