Skip to content

Commit 0856624

Browse files
authored
Merge pull request #237 from stackhpc/feat/remove-cloud-init
Remove cloud_init role
2 parents f47c982 + a43f8b7 commit 0856624

File tree

16 files changed

+53
-142
lines changed

16 files changed

+53
-142
lines changed

.github/workflows/stackhpc.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,21 +53,13 @@ jobs:
5353
shell: bash
5454
env:
5555
arcus_CLOUDS_YAML: ${{ secrets.ARCUS_CLOUDS_YAML }}
56-
57-
- name: Provision ports, inventory and other infrastructure apart from nodes
58-
run: |
59-
. venv/bin/activate
60-
. environments/${{ matrix.cloud }}/activate
61-
cd $APPLIANCES_ENVIRONMENT_ROOT/terraform
62-
TF_VAR_create_nodes=false terraform apply -auto-approve
63-
56+
6457
- name: Setup environment-specific inventory/terraform inputs
6558
run: |
6659
. venv/bin/activate
6760
. environments/${{ matrix.cloud }}/activate
6861
ansible-playbook ansible/adhoc/generate-passwords.yml
6962
echo vault_testuser_password: "$TESTUSER_PASSWORD" > $APPLIANCES_ENVIRONMENT_ROOT/inventory/group_vars/all/test_user.yml
70-
ansible-playbook ansible/adhoc/template-cloud-init.yml
7163
env:
7264
TESTUSER_PASSWORD: ${{ secrets.TEST_USER_PASSWORD }}
7365

ansible/bootstrap.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,8 @@
1818
tags: etc_hosts
1919
become: yes
2020
tasks:
21-
- name: Template /etc/hosts
22-
copy:
23-
content: "{{ etc_hosts_template }}"
24-
dest: /etc/hosts
25-
owner: root
26-
group: root
27-
mode: u=rw,og=r
21+
- import_role:
22+
name: etc_hosts
2823

2924
- hosts: cluster
3025
gather_facts: false

ansible/roles/cloud_init/README.md

Lines changed: 0 additions & 31 deletions
This file was deleted.

ansible/roles/cloud_init/defaults/main.yml

Lines changed: 0 additions & 2 deletions
This file was deleted.

ansible/roles/cloud_init/tasks/template.yml

Lines changed: 0 additions & 5 deletions
This file was deleted.

ansible/roles/cloud_init/templates/userdata.yml.j2

Lines changed: 0 additions & 13 deletions
This file was deleted.

ansible/roles/etc_hosts/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# etc_hosts
22

3-
This role provides documentation only.
3+
Hosts in the `etc_hosts` groups have `/etc/hosts` created. The generated file defines all hosts in this group using `ansible_host` as the IP address and `inventory_hostname` as the canonical hostname. This may need overriding for multi-homed hosts. See `environments/common/inventory/group_vars/all/cloud_init.yml` for configuration.
44

5-
Hosts in the `etc_hosts` groups get `/etc/hosts` created via `cloud-init`. The generated file defines all hosts in this group using `ansible_host` as the IP address and `inventory_hostname` as the canonical hostname. This may need overriding for multi-homed hosts. See `environments/common/inventory/group_vars/all/cloud_init.yml` for configuration.
5+
# Variables:
6+
7+
- `etc_hosts_template`: Template file to use. Default uses in-role template.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
etc_hosts_template: hosts.j2
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
- name: Template out /etc/hosts
2+
template:
3+
src: "{{ etc_hosts_template }}"
4+
dest: /etc/hosts
5+
owner: root
6+
group: root
7+
mode: 0644
8+
become: yes
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
2+
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
3+
4+
{% for hostname in groups['etc_hosts'] | sort -%}
5+
{{ hostvars[hostname]['ansible_host'] }} {{ hostname }}
6+
{% endfor -%}

0 commit comments

Comments
 (0)