Skip to content

Commit cda9669

Browse files
committed
add wip for the gatters
1 parent 185fc2b commit cda9669

File tree

3 files changed

+71
-0
lines changed

3 files changed

+71
-0
lines changed

bootstrap-instances/password.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
- name: Update Passwords
3+
hosts: workshop_instances
4+
tasks:
5+
# For some instances, they don't come pre-configured with a password, so we do that now.
6+
- name: Generate a host-specific password
7+
# Here we use the echo/cat pattern in order to generate lightly salted versions.
8+
# Mostly useful if you have one workshop, then another.
9+
command: |
10+
/usr/bin/pwgen -H /etc/hostname 10 1
11+
register: actual_pw
12+
13+
- name: Set a password if requested
14+
user:
15+
name: ubuntu
16+
password: "{{ actual_pw.stdout | password_hash('sha512', 'gatGATgat') }}"
17+
18+
- name: "Output password for admins"
19+
debug:
20+
msg: "password: {{ inventory_hostname }} {{ actual_pw.stdout }}"

bootstrap-instances/templates/hosts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[galaxyservers]
2+
{{ inventory_hostname }} ansible_connection=local ansible_user=ubuntu

bootstrap-instances/up-to.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
- name: Bring machines up to specific point
3+
hosts: workshop_instances
4+
vars:
5+
# 2022-03-30 # Before any changes, last step of step 4 # CVMFS = step-5
6+
git_gat_version: b4e777e9f64e05ab0beb05c5b2b1f4428f2c58d4
7+
tasks:
8+
- name: Git checkout
9+
ansible.builtin.git:
10+
repo: 'https://github.com/hexylena/git-gat/'
11+
dest: galaxy/
12+
version: "{{ git_gat_version }}"
13+
force: yes
14+
15+
- name: Fix ansible
16+
command: pip install -U ansible
17+
18+
# BEGIN CVMFS Hacks
19+
- name: Wipe out CVMFS
20+
command: rm -rf roles/galaxyproject.cvmfs/
21+
args:
22+
chdir: galaxy/
23+
24+
- name: Hackily use latest version of CVMFS role.
25+
ansible.builtin.lineinfile:
26+
path: galaxy/requirements.yml
27+
regexp: ' version: 0.2.13'
28+
line: ' version: 0.2.16'
29+
# END CVMFS Hacks
30+
31+
- name: Install deps
32+
command: ansible-galaxy install -r requirements.yml -p roles
33+
args:
34+
chdir: galaxy/
35+
36+
- name: Setup hosts file
37+
ansible.builtin.template:
38+
src: templates/hosts
39+
dest: galaxy/hosts
40+
41+
- name: Setup vault password
42+
ansible.builtin.copy:
43+
content: "password"
44+
dest: galaxy/.vault-password.txt
45+
46+
- name: Setup Galaxy
47+
command: ansible-playbook galaxy.yml
48+
args:
49+
chdir: galaxy/

0 commit comments

Comments
 (0)