Skip to content

Commit fef3d56

Browse files
committed
repos now timestamped + synced at bootstrap
1 parent 25644c3 commit fef3d56

File tree

10 files changed

+82
-77
lines changed

10 files changed

+82
-77
lines changed

.github/workflows/fatimage.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
}
4141
}
4242
ARK_PASSWORD: ${{ secrets.ARK_PASSWORD }}
43+
LEAFCLOUD_PULP_PASSWORD: ${{ secrets.LEAFCLOUD_PULP_PASSWORD }}
4344

4445
steps:
4546
- uses: actions/checkout@v2

.github/workflows/nightlybuild.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ jobs:
3838
"RL9": "Rocky-9-GenericCloud-Base-9.4-20240523.0.x86_64.qcow2"
3939
}
4040
ARK_PASSWORD: ${{ secrets.ARK_PASSWORD }}
41+
LEAFCLOUD_PULP_PASSWORD: ${{ secrets.LEAFCLOUD_PULP_PASSWORD }}
4142

4243
steps:
4344
- uses: actions/checkout@v2

ansible/adhoc/deploy-pulp.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,3 @@
2626
content: |
2727
# ansible managed
2828
appliances_pulp_url: "http://{{ pulp_server }}:{{ pulp_site_port }}"
29-
30-
# - name: Add pulp host to environment
31-
# hosts: localhost
32-
# tasks:
33-
# - ansible.builtin.copy:
34-
# dest: "{{ lookup('env', 'APPLIANCES_ENVIRONMENT_ROOT') }}/inventory/group_vars/all/pulp_server.yml"
35-
# content: |
36-
# # ansible managed
37-
# appliances_pulp_url: "http://{{ pulp_server }}:{{ pulp_site_port }}"

ansible/bootstrap.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,15 @@
111111
register: sestatus
112112

113113
- name: Sync pulp repos with upstream
114-
hosts: localhost
114+
hosts: pulp
115115
tasks:
116+
- debug:
117+
var: hostvars[groups['builder'][0]]['ansible_facts']
116118
- ansible.builtin.include_role:
117119
name: pulp_site
118120
tasks_from: sync.yml
121+
apply:
122+
delegate_to: localhost
119123
when: appliances_mode != 'configure'
120124

121125
- hosts: dnf_repos

ansible/roles/dnf_repos/defaults/main.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,21 @@ dnf_repos_pulp_content_url: "{{ dnf_repos_pulp_url }}/pulp/content"
33
dnf_repos_rocky_prefix: "{{ ansible_distribution | lower }}/{{ ansible_distribution_version }}"
44
dnf_repos_epel_prefix: "epel/{{ ansible_distribution_major_version }}"
55
dnf_repos_disable: true
6+
dnf_repos_version_timestamps: "{{ appliances_repo_timestamps[ansible_distribution_version] }}"
67

78
# epel installed separately
89
dnf_repos_repolist:
910
- file: rocky
1011
name: baseos
11-
base_url: "{{ dnf_repos_pulp_content_url }}/{{ dnf_repos_rocky_prefix }}/baseos"
12+
base_url: "{{ dnf_repos_pulp_content_url }}/{{ dnf_repos_rocky_prefix }}/baseos/{{ dnf_repos_version_timestamps.baseos }}"
1213
- file: rocky
1314
name: appstream
14-
base_url: "{{ dnf_repos_pulp_content_url }}/{{ dnf_repos_rocky_prefix }}/appstream"
15+
base_url: "{{ dnf_repos_pulp_content_url }}/{{ dnf_repos_rocky_prefix }}/appstream/{{ dnf_repos_version_timestamps.appstream }}"
1516
- file: rocky
1617
name: crb
17-
base_url: "{{ dnf_repos_pulp_content_url }}/{{ dnf_repos_rocky_prefix }}/crb"
18+
base_url: "{{ dnf_repos_pulp_content_url }}/{{ dnf_repos_rocky_prefix }}/crb/{{ dnf_repos_version_timestamps.crb }}"
1819
- file: rocky-extras
1920
name: extras
20-
base_url: "{{ dnf_repos_pulp_content_url }}/{{ dnf_repos_rocky_prefix }}/extras"
21+
base_url: "{{ dnf_repos_pulp_content_url }}/{{ dnf_repos_rocky_prefix }}/extras/{{ dnf_repos_version_timestamps.extras }}"
2122

22-
dnf_repos_epel_baseurl: "{{ dnf_repos_pulp_content_url }}/epel/{{ ansible_distribution_major_version }}"
23+
dnf_repos_epel_baseurl: "{{ dnf_repos_pulp_content_url }}/epel/{{ ansible_distribution_version }}/{{ dnf_repos_version_timestamps.epel }}"

ansible/roles/pulp_site/defaults/main.yml

Lines changed: 48 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -3,73 +3,70 @@ pulp_site_port: 8080
33
pulp_site_username: admin # shouldn't be changed
44
pulp_site_upstream_username: slurm-app-ci
55
pulp_site_upstream_password: "{{ lookup('ansible.builtin.env', 'ARK_PASSWORD') }}"
6+
pulp_site_default_upstream_prefix: "https://ark.stackhpc.com/pulp/content/{{ pulp_site_target_distribution }}/{{ pulp_site_target_distribution_version }}"
7+
pulp_site_default_upstream_suffix: "{{ pulp_site_target_arch }}/os"
68
pulp_site_password: "{{ vault_pulp_admin_password }}"
79
pulp_site_validate_certs: false
810
pulp_site_install_dir: '/home/rocky/pulp'
911
pulp_site_selinux_suffix: "{{ ':Z' if ansible_selinux.status == 'enabled' else '' }}"
12+
pulp_site_target_facts: "{{ hostvars[groups['builder'][0]]['ansible_facts'] }}"
13+
pulp_site_target_arch: "{{ pulp_site_target_facts['architecture'] }}"
14+
pulp_site_target_distribution: "{{ pulp_site_target_facts['distribution'] | lower }}"
15+
pulp_site_target_distribution_version: "{{ pulp_site_target_facts['distribution_version'] }}"
16+
pulp_site_target_distribution_version_major: "{{ pulp_site_target_facts['distribution_major_version'] }}"
17+
pulp_site_version_timestamps: "{{ appliances_repo_timestamps[pulp_site_target_distribution_version] }}"
1018

11-
pulp_site_rpm_repos:
12-
- name: baseos
13-
url: https://ark.stackhpc.com/pulp/content/rocky/9.4/BaseOS/x86_64/os/20240816T002610
14-
remote_username: "{{ pulp_site_upstream_username }}"
15-
remote_password: "{{ pulp_site_upstream_password }}"
16-
policy: on_demand
17-
state: present
18-
- name: appstream
19-
url: https://ark.stackhpc.com/pulp/content/rocky/9.4/AppStream/x86_64/os/20240816T002610
20-
remote_username: "{{ pulp_site_upstream_username }}"
21-
remote_password: "{{ pulp_site_upstream_password }}"
22-
policy: on_demand
23-
state: present
24-
- name: crb
25-
url: https://ark.stackhpc.com/pulp/content/rocky/9.4/CRB/x86_64/os/20240816T002610
26-
remote_username: "{{ pulp_site_upstream_username }}"
27-
remote_password: "{{ pulp_site_upstream_password }}"
28-
policy: on_demand
29-
state: present
30-
- name: extras
31-
url: https://ark.stackhpc.com/pulp/content/rocky/9.4/extras/x86_64/os/20240816T002610
32-
remote_username: "{{ pulp_site_upstream_username }}"
33-
remote_password: "{{ pulp_site_upstream_password }}"
34-
policy: on_demand
35-
state: present
36-
- name: epel
37-
url: https://ark.stackhpc.com/pulp/content/epel/9/Everything/x86_64/20240902T080424
38-
remote_username: "{{ pulp_site_upstream_username }}"
39-
remote_password: "{{ pulp_site_upstream_password }}"
40-
policy: on_demand
41-
state: present
19+
20+
pulp_site_rpm_repo_list:
21+
- name: "baseos-{{ pulp_site_target_distribution_version }}-{{ pulp_site_version_timestamps.baseos }}"
22+
url: "{{ pulp_site_default_upstream_prefix }}/BaseOS/{{ pulp_site_default_upstream_suffix }}/{{ pulp_site_version_timestamps.baseos }}"
23+
- name: "appstream-{{ pulp_site_target_distribution_version }}-{{ pulp_site_version_timestamps.appstream }}"
24+
url: "{{ pulp_site_default_upstream_prefix }}/AppStream/{{ pulp_site_default_upstream_suffix }}/{{ pulp_site_version_timestamps.appstream }}"
25+
- name: "crb-{{ pulp_site_target_distribution_version }}-{{ pulp_site_version_timestamps.crb }}"
26+
url: "{{ pulp_site_default_upstream_prefix }}/{{ 'PowerTools' if pulp_site_target_distribution_version_major == '8' else 'CRB' }}/{{ pulp_site_default_upstream_suffix }}/{{ pulp_site_version_timestamps.crb }}"
27+
- name: "extras-{{ pulp_site_target_distribution_version }}-{{ pulp_site_version_timestamps.extras }}"
28+
url: "{{ pulp_site_default_upstream_prefix }}/extras/{{ pulp_site_default_upstream_suffix }}/{{ pulp_site_version_timestamps.extras }}"
29+
- name: "epel-{{ pulp_site_target_distribution_version }}-{{ pulp_site_version_timestamps.epel }}"
30+
url: "https://ark.stackhpc.com/pulp/content/epel/{{ pulp_site_target_distribution_version_major }}/Everything/{{ pulp_site_target_arch }}/{{ pulp_site_version_timestamps.epel }}"
31+
32+
pulp_site_defaults:
33+
remote_username: "{{ pulp_site_upstream_username }}"
34+
remote_password: "{{ pulp_site_upstream_password }}"
35+
policy: on_demand
36+
state: present
37+
38+
pulp_site_rpm_repos: "{{ pulp_site_rpm_repo_list | map('combine', pulp_site_defaults) }}"
4239

4340
pulp_site_rpm_publications:
44-
- repository: baseos
41+
- repository: "baseos-{{ pulp_site_target_distribution_version }}-{{ pulp_site_version_timestamps.baseos }}"
4542
state: present
46-
- repository: appstream
43+
- repository: "appstream-{{ pulp_site_target_distribution_version }}-{{ pulp_site_version_timestamps.appstream }}"
4744
state: present
48-
- repository: crb
45+
- repository: "crb-{{ pulp_site_target_distribution_version }}-{{ pulp_site_version_timestamps.crb }}"
4946
state: present
50-
- repository: extras
47+
- repository: "extras-{{ pulp_site_target_distribution_version }}-{{ pulp_site_version_timestamps.extras }}"
5148
state: present
52-
- repository: epel
49+
- repository: "epel-{{ pulp_site_target_distribution_version }}-{{ pulp_site_version_timestamps.epel }}"
5350
state: present
5451

5552
pulp_site_rpm_distributions:
56-
- name: baseos
57-
base_path: rocky/9.4/baseos
58-
repository: baseos
53+
- name: "baseos-{{ pulp_site_target_distribution_version }}-{{ pulp_site_version_timestamps.baseos }}"
54+
base_path: "rocky/{{ pulp_site_target_distribution_version }}/baseos/{{ pulp_site_version_timestamps.baseos }}"
55+
repository: "baseos-{{ pulp_site_target_distribution_version }}-{{ pulp_site_version_timestamps.baseos }}"
5956
state: present
60-
- name: appstream
61-
base_path: rocky/9.4/appstream
62-
repository: appstream
57+
- name: "appstream-{{ pulp_site_target_distribution_version }}-{{ pulp_site_version_timestamps.appstream }}"
58+
base_path: "rocky/{{ pulp_site_target_distribution_version }}/appstream/{{ pulp_site_version_timestamps.appstream }}"
59+
repository: "appstream-{{ pulp_site_target_distribution_version }}-{{ pulp_site_version_timestamps.appstream }}"
6360
state: present
64-
- name: crb
65-
base_path: rocky/9.4/crb
66-
repository: crb
61+
- name: "crb-{{ pulp_site_target_distribution_version }}-{{ pulp_site_version_timestamps.crb }}"
62+
base_path: "rocky/{{ pulp_site_target_distribution_version }}/crb/{{ pulp_site_version_timestamps.crb }}"
63+
repository: "crb-{{ pulp_site_target_distribution_version }}-{{ pulp_site_version_timestamps.crb }}"
6764
state: present
68-
- name: extras
69-
base_path: rocky/9.4/extras
70-
repository: extras
65+
- name: "extras-{{ pulp_site_target_distribution_version }}-{{ pulp_site_version_timestamps.extras }}"
66+
base_path: "rocky/{{ pulp_site_target_distribution_version }}/extras/{{ pulp_site_version_timestamps.extras }}"
67+
repository: "extras-{{ pulp_site_target_distribution_version }}-{{ pulp_site_version_timestamps.extras }}"
7168
state: present
72-
- name: epel
73-
base_path: epel/9
74-
repository: epel
69+
- name: "epel-{{ pulp_site_target_distribution_version }}-{{ pulp_site_version_timestamps.epel }}"
70+
base_path: "epel/{{ pulp_site_target_distribution_version }}/{{ pulp_site_version_timestamps.epel }}"
71+
repository: "epel-{{ pulp_site_target_distribution_version }}-{{ pulp_site_version_timestamps.epel }}"
7572
state: present

environments/.stackhpc/hooks/pre.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,3 @@
1717
- "{{ lookup('env', 'APPLIANCES_ENVIRONMENT_ROOT') }}/inventory/hosts.yml"
1818
- "{{ lookup('env', 'APPLIANCES_ENVIRONMENT_ROOT') }}/inventory/group_vars/all/secrets.yml"
1919
- "{{ lookup('env', 'APPLIANCES_ENVIRONMENT_ROOT') }}/inventory/group_vars/all/test_user.yml"
20-
21-
- hosts: builder
22-
become: yes
23-
tasks:
24-
- name: Replace system repos with ark
25-
ansible.builtin.include_role:
26-
name: dnf_repos
27-
tasks_from: set_repos.yml
28-
when: ansible_distribution_major_version == "9" #TODO update role once RL8 config decided
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
1-
#update_enable: false # Can uncomment for speed debugging non-update related build issues
2-
appliances_pulp_url: http://192.168.10.157:8080
1+
# update_enable: false # Can uncomment for speed debugging non-update related build issues
2+
pulp_server_config:
3+
LEAFCLOUD:
4+
url: http://192.168.10.157:8080
5+
password: lookup('env','LEAFCLOUD_PULP_PASSWORD')
6+
7+
appliances_pulp_url: "{{ pulp_server_config[lookup('env','CI_CLOUD')].url }}"
8+
pulp_site_password: "{{ pulp_server_config[lookup('env','CI_CLOUD')].password }}"

environments/common/inventory/group_vars/all/defaults.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,11 @@ appliances_local_users_extra: [] # see format of appliances_local_users_default
8181
appliances_local_users: "{{ appliances_local_users_default + appliances_local_users_extra }}"
8282

8383
###########################################################################################
84+
85+
appliances_repo_timestamps:
86+
'9.4':
87+
baseos: 20240816T002610
88+
appstream: 20240816T002610
89+
crb: 20240816T002610
90+
extras: 20240816T002610
91+
epel: 20240902T080424

environments/common/inventory/groups

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,3 +148,8 @@ freeipa_client
148148
[dnf_repos:children]
149149
# Hosts to replace system repos with Pulp repos
150150
cluster
151+
builder
152+
153+
[pulp:children]
154+
# Hosts used to run Pulp API commands
155+
builder

0 commit comments

Comments
 (0)