-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update k8s Readme and re add the manual setups for local machine setups
- Loading branch information
Showing
6 changed files
with
165 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
galaxy_info: | ||
author: Pasarus | ||
description: Mount the archive on the nodes | ||
license: GPLv3 | ||
|
||
min_ansible_version: "5.0" | ||
|
||
platforms: | ||
- name: Ubuntu | ||
versions: | ||
- focal | ||
|
||
dependencies: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
--- | ||
- name: Mount the archive | ||
become: true | ||
block: | ||
- name: Install cifs-utils and keyutils | ||
apt: | ||
update_cache: true | ||
name: "{{item}}" | ||
state: present | ||
with_items: | ||
- cifs-utils | ||
- keyutils | ||
when: "'workers' in group_names or inventory_hostname == 'localhost'" | ||
|
||
- name: Create mountpoint | ||
ansible.builtin.file: | ||
path: /archive | ||
state: directory | ||
mode: "u=rwx,g=rx,o=rx" | ||
when: "'workers' in group_names or inventory_hostname == 'localhost'" | ||
|
||
- name: Ensure credentials file is present | ||
ansible.builtin.lineinfile: | ||
path: /archive.creds | ||
search_string: "{{item}}" | ||
line: "{{item}}" | ||
create: true | ||
mode: "u=rwx,g=,o=" | ||
state: present | ||
with_items: | ||
- username={{ isis_archive.username }} | ||
- password={{ isis_archive.password }} | ||
- domain={{ isis_archive.domain }} | ||
when: "'workers' in group_names or inventory_hostname == 'localhost'" | ||
|
||
- name: Ensure DNS config is setup for the archive | ||
ansible.builtin.blockinfile: | ||
path: /etc/systemd/resolved.conf | ||
state: present | ||
create: true | ||
mode: "u=rw,g=r,o=r" | ||
block: | | ||
[Resolve] | ||
Domains=isis.cclrc.ac.uk | ||
when: "'workers' in group_names or inventory_hostname == 'localhost'" | ||
|
||
- name: Restart resolved to ensure DNS configuration is up to date | ||
ansible.builtin.service: | ||
name: systemd-resolved.service | ||
state: restarted | ||
when: "'workers' in group_names or inventory_hostname == 'localhost'" | ||
|
||
- name: Ensure mount is configured | ||
ansible.builtin.mount: | ||
path: /archive | ||
src: "//isis.cclrc.ac.uk/inst$/" | ||
fstype: cifs | ||
opts: "noserverino,vers=2.1,credentials=/archive.creds,_netdev" | ||
state: mounted | ||
retries: 100 | ||
delay: 1 | ||
register: result | ||
until: result.failed == false | ||
when: "'workers' in group_names or inventory_hostname == 'localhost'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
galaxy_info: | ||
author: Pasarus | ||
description: Mount ceph on the nodes | ||
license: GPLv3 | ||
|
||
min_ansible_version: "5.0" | ||
|
||
platforms: | ||
- name: Ubuntu | ||
versions: | ||
- focal | ||
|
||
dependencies: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--- | ||
- name: Mount ceph | ||
become: true | ||
block: | ||
- name: Create autoreduce group | ||
group: | ||
name: autoreduce | ||
gid: "{{ isis_ceph.uid }}" | ||
state: present | ||
when: "'workers' in group_names or inventory_hostname == 'localhost'" | ||
|
||
- name: Create autoreduce user | ||
user: | ||
name: autoreduce | ||
shell: /bin/bash | ||
state: present | ||
uid: "{{ isis_ceph.uid }}" | ||
group: autoreduce | ||
when: "'workers' in group_names or inventory_hostname == 'localhost'" | ||
|
||
- name: Ensure dependencies are installed | ||
apt: | ||
update_cache: true | ||
name: ceph | ||
state: present | ||
when: "'workers' in group_names or inventory_hostname == 'localhost'" | ||
|
||
- name: Create directory | ||
ansible.builtin.file: | ||
path: /ceph | ||
state: directory | ||
mode: "u=rwx,g=rx,o=rx" | ||
when: "'workers' in group_names or inventory_hostname == 'localhost'" | ||
|
||
- name: Ensure ceph secret key is present | ||
ansible.builtin.copy: | ||
dest: /etc/ceph/deneb.key | ||
content: "{{ isis_ceph.key }}" | ||
owner: root | ||
group: root | ||
mode: "u=r,g=,o=" | ||
when: "'workers' in group_names or inventory_hostname == 'localhost'" | ||
|
||
- name: Mount CEPH | ||
ansible.builtin.mount: | ||
path: /ceph | ||
src: deneb-mon1.nubes.rl.ac.uk,deneb-mon2.nubes.rl.ac.uk,deneb-mon3.nubes.rl.ac.uk:/isis/instrument | ||
fstype: ceph | ||
opts: "name=isis_autoreduce,secretfile=/etc/ceph/deneb.key,noatime,_netdev" | ||
state: mounted | ||
retries: 100 | ||
delay: 1 | ||
register: result | ||
until: result.failed == false | ||
when: "'workers' in group_names or inventory_hostname == 'localhost'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
- name: Setup the local machine | ||
hosts: localhost | ||
vars_files: | ||
- vars/vault.yml | ||
roles: | ||
- role: isis-archive | ||
- role: isis-ceph | ||
|
||
tasks: | ||
- name: Set permissions of /archive directory which is suitable for minikube to access it | ||
become: true | ||
file: | ||
path: /archive | ||
mode: '0777' |