Skip to content

Commit

Permalink
testing changes
Browse files Browse the repository at this point in the history
  • Loading branch information
viniciusdc committed Feb 28, 2024
1 parent acab774 commit 3df5f22
Show file tree
Hide file tree
Showing 65 changed files with 320 additions and 288 deletions.
13 changes: 7 additions & 6 deletions playbook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
hosts: all
pre_tasks:
- name: Gather facts from ALL hosts (regardless of limit or tags)

Check failure on line 5 in playbook.yaml

View workflow job for this annotation

GitHub Actions / Ansible Lint

fqcn[action-core]

Use FQCN for builtin module actions (setup).
ansible.builtin.setup:
setup:
delegate_to: "{{ item }}"
delegate_facts: true
when: hostvars[item]['ansible_default_ipv4'] is not defined
with_items: "{{ groups['all'] }}"
- name: Copy files

Check failure on line 11 in playbook.yaml

View workflow job for this annotation

GitHub Actions / Ansible Lint

fqcn[action-core]

Use FQCN for builtin module actions (include_tasks).
ansible.builtin.include_tasks: tasks/copy_files.yaml
include_tasks: tasks/copy_files.yaml
loop: '{{ ["all"] + group_names + [inventory_hostname_short] }}'
loop_control:
loop_var: myhost
Expand Down Expand Up @@ -45,14 +45,15 @@

tasks:
- name: Additional ansible tasks

Check failure on line 47 in playbook.yaml

View workflow job for this annotation

GitHub Actions / Ansible Lint

fqcn[action-core]

Use FQCN for builtin module actions (include_tasks).
ansible.builtin.include_tasks: "{{ item }}"
include_tasks: "{{ item }}"
with_items: "{{ additional_tasks | default([]) }}"

- name: Keycloak administration credentials

Check failure on line 51 in playbook.yaml

View workflow job for this annotation

GitHub Actions / Ansible Lint

fqcn[action-core]

Use FQCN for builtin module actions (debug).
ansible.builtin.debug:
msg: Keycloak administration username={{ keycloak_admin_username }} via https://{{ traefik_domain | default(hostvars[groups['hpc_master'][0]].ansible_ssh_host)
debug:
msg:
Keycloak administration username={{ keycloak_admin_username }} via https://{{ traefik_domain | default(hostvars[groups['hpc_master'][0]].ansible_ssh_host)
}}/auth/admin/

- name: Accessing cluster

Check failure on line 57 in playbook.yaml

View workflow job for this annotation

GitHub Actions / Ansible Lint

fqcn[action-core]

Use FQCN for builtin module actions (debug).
ansible.builtin.debug:
debug:
msg: "Access cluster via following url: https://{{ traefik_domain | default(hostvars[groups['hpc_master'][0]].ansible_ssh_host) }}"
25 changes: 25 additions & 0 deletions requirements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,28 @@ collections:
- name: community.general
version: 4.2.0
- name: ansible.posix
# [2024-02-28T01:55:29.723] error: xcpuinfo_hwloc_topo_load: failed (load will be required after read failures).
# [2024-02-28T01:55:29.723] error: Node configuration differs from hardware: Procs=1:4(hw) Boards=1:1(hw) SocketsPerBoard=1:4(hw) CoresPerSocket=1:1(hw) ThreadsPerCore=1:1(hw)
# [2024-02-28T01:55:29.723] Message aggregation disabled
# [2024-02-28T01:55:29.723] error: chmod(/var/lib/slurm/slurmd, 0755): Operation not permitted
# [2024-02-28T01:55:29.723] error: Unable to initialize slurmd spooldir
# [2024-02-28T01:55:29.723] error: slurmd initialization failed
# [2024-02-28T02:07:49.035] error: xcpuinfo_hwloc_topo_load: failed (load will be required after read failures).
# [2024-02-28T02:07:49.036] error: Node configuration differs from hardware: Procs=1:4(hw) Boards=1:1(hw) SocketsPerBoard=1:4(hw) CoresPerSocket=1:1(hw) ThreadsPerCore=1:1(hw)
# [2024-02-28T02:07:49.036] Message aggregation disabled
# [2024-02-28T02:07:49.036] error: chmod(/var/lib/slurm/slurmd, 0755): Operation not permitted
# [2024-02-28T02:07:49.036] error: Unable to initialize slurmd spooldir
# [2024-02-28T02:07:49.036] error: slurmd initialization failed

# [2024-02-28T02:19:10.606] Message aggregation disabled
# [2024-02-28T02:19:10.607] CPU frequency setting not configured for this node
# [2024-02-28T02:19:10.609] slurmd version 19.05.5 started
# [2024-02-28T02:19:10.609] slurmd started on Wed, 28 Feb 2024 02:19:10 +0000
# [2024-02-28T02:19:10.609] CPUs=1 Boards=1 Sockets=1 Cores=1 Threads=1 Memory=5929 TmpDisk=126039 Uptime=3434 CPUSpecList=(null) FeaturesAvail=(null) FeaturesActive=(null)
# [2024-02-28T02:19:13.330] Slurmd shutdown completing
# [2024-02-28T02:19:13.413] error: Node configuration differs from hardware: Procs=1:4(hw) Boards=1:1(hw) SocketsPerBoard=1:4(hw) CoresPerSocket=1:1(hw) ThreadsPerCore=1:1(hw)
# [2024-02-28T02:19:13.413] Message aggregation disabled
# [2024-02-28T02:19:13.415] CPU frequency setting not configured for this node
# [2024-02-28T02:19:13.416] slurmd version 19.05.5 started
# [2024-02-28T02:19:13.416] slurmd started on Wed, 28 Feb 2024 02:19:13 +0000
# [2024-02-28T02:19:13.417] CPUs=1 Boards=1 Sockets=1 Cores=1 Threads=1 Memory=5929 TmpDisk=126039 Uptime=3437 CPUSpecList=(null) FeaturesAvail=(null) FeaturesActive=(null)
8 changes: 4 additions & 4 deletions roles/accounts/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
- name: Ensure groups are present

Check failure on line 2 in roles/accounts/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

fqcn[action-core]

Use FQCN for builtin module actions (group).
become: true
ansible.builtin.group:
group:
name: "{{ item.name }}"
gid: "{{ item.gid }}"
state: present
with_items: "{{ enabled_groups }}"

- name: Ensure users are present

Check failure on line 10 in roles/accounts/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

fqcn[action-core]

Use FQCN for builtin module actions (user).
become: true
ansible.builtin.user:
user:
name: "{{ item.username }}"
uid: "{{ item.uid }}"
shell: /bin/bash
Expand All @@ -25,14 +25,14 @@

- name: Ensure users are disabled

Check failure on line 26 in roles/accounts/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

fqcn[action-core]

Use FQCN for builtin module actions (user).
become: true
ansible.builtin.user:
user:
name: "{{ item }}"
state: absent
with_items: "{{ disabled_users }}"

- name: Ensure groups are disabled

Check failure on line 33 in roles/accounts/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

fqcn[action-core]

Use FQCN for builtin module actions (group).
become: true
ansible.builtin.group:
group:
name: "{{ item }}"
state: absent
with_items: "{{ disabled_groups }}"
2 changes: 1 addition & 1 deletion roles/apt_packages/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- name: Ensure apt packages are installed

Check failure on line 2 in roles/apt_packages/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

fqcn[action-core]

Use FQCN for builtin module actions (apt).
become: true
ansible.builtin.apt:
apt:
name: "{{ installed_packages }}"
state: latest
update_cache: true
Expand Down
14 changes: 7 additions & 7 deletions roles/backups/tasks/backup.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
- name: Ensure restic installed
become: true
ansible.builtin.apt:
apt:
name: restic
state: latest
update_cache: true
cache_valid_time: 3600

- name: Ensure that restic backup configuration directory exists
become: true
ansible.builtin.file:
file:
path: /etc/restic
state: directory
mode: "0700"
Expand All @@ -18,7 +18,7 @@

- name: Restic Backup Service
become: true
ansible.builtin.copy:
copy:
content: |
{% for key, value in backup_environment.items() %}
{{ key }}={{ value }}
Expand All @@ -31,7 +31,7 @@

- name: Restic Backup Service
become: true
ansible.builtin.copy:
copy:
content: |
[Unit]
Description=Restic Backup
Expand All @@ -52,7 +52,7 @@

- name: Restic Backup Timer
become: true
ansible.builtin.copy:
copy:
content: |
[Unit]
Description=Restic Backup Timer
Expand All @@ -71,15 +71,15 @@

- name: Ensure restic backup service is enabled on boot
become: true
ansible.builtin.systemd:
systemd:
daemon_reload: true
name: restic-backup.service
enabled: true
state: started

- name: Ensure restic backup timer is enabled on boot
become: true
ansible.builtin.systemd:
systemd:
daemon_reload: true
name: restic-backup.timer
enabled: true
Expand Down
2 changes: 1 addition & 1 deletion roles/backups/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
- name: Backup configuration
ansible.builtin.include_tasks: backup.yaml
include_tasks: backup.yaml
when: backup_enabled
8 changes: 4 additions & 4 deletions roles/bodo/tasks/bodo.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
---
- name: Install Bodo Environment
ansible.builtin.include_role:
include_role:
name: conda_environment
vars:
environment_path: "{{ bodo_environment_path }}"

- name: Ensure bodo license directory exists
become: true
ansible.builtin.file:
file:
path: "{{ miniforge_home }}/envs/bodo/share/bodo"
state: directory
mode: "0755"

- name: Write bodo license
become: true
ansible.builtin.copy:
copy:
content: "{{ bodo_license }}"
dest: "{{ miniforge_home }}/envs/bodo/share/bodo/bodo.license"
mode: "644"

- name: Ensure bodo.sh activated in shell
become: true
ansible.builtin.copy:
copy:
content: |
export BODO_LICENSE={{ miniforge_home }}/envs/bodo/share/bodo/bodo.license
dest: /etc/profile.d/bodo.sh
Expand Down
2 changes: 1 addition & 1 deletion roles/bodo/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
- name: Install bodo
ansible.builtin.include_tasks: bodo.yaml
include_tasks: bodo.yaml
when: bodo_enabled
4 changes: 2 additions & 2 deletions roles/cifs/handlers/main.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
- name: Restart services samba
become: true
ansible.builtin.service:
service:
name: "{{ item }}"
enabled: "yes"
state: restarted
cmd: ""

with_items:
- smbd
10 changes: 5 additions & 5 deletions roles/cifs/tasks/client.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
- name: Install cifs
become: true
ansible.builtin.apt:
apt:
state: latest
cache_valid_time: 3600
name:
- cifs-utils

- name: Wait for samba server at host to be available
ansible.builtin.wait_for:
wait_for:
host: "{{ item.host }}"
port: 445
timeout: 600
Expand All @@ -17,15 +17,15 @@

- name: Ensure samba mounted directories exist
become: true
ansible.builtin.file:
file:
path: "{{ item.path }}"
state: directory
with_items: "{{ samba_client_mounts }}"
no_log: true # Avoid logging user creds

- name: Ensure samba credentials directory exists
become: true
ansible.builtin.file:
file:
path: /etc/samba/credentials
state: directory
owner: root
Expand All @@ -34,7 +34,7 @@

- name: Add credentials for particular mount
become: true
ansible.builtin.copy:
copy:
content: |
{% if item.username is defined %}
username={{ item.username }}
Expand Down
4 changes: 2 additions & 2 deletions roles/cifs/tasks/main.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
- name: Install samba server
ansible.builtin.include_tasks: server.yaml
include_tasks: server.yaml
when: samba_server_enabled

- name: Install samba client
ansible.builtin.include_tasks: client.yaml
include_tasks: client.yaml
when: samba_client_enabled
8 changes: 4 additions & 4 deletions roles/cifs/tasks/server.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
---
- name: Install samba
become: true
ansible.builtin.apt:
apt:
state: latest
cache_valid_time: 3600
name:
- samba

- name: Ensure samba server share directories exist
become: true
ansible.builtin.file:
file:
path: "{{ item.path }}"
state: directory
with_items: "{{ samba_server_shares }}"

- name: Copy the samba configuration
become: true
ansible.builtin.template:
template:
src: templates/smb.conf.j2
dest: /etc/samba/smb.conf
owner: root
group: root
mode: "0644"
notify: restart services samba
notify: Restart services samba
9 changes: 5 additions & 4 deletions roles/conda_environment/tasks/main.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
---
- name: Create environments directory
become: true
ansible.builtin.file:
file:
path: /opt/conda-environments
state: directory

- name: Copy environments files
become: true
ansible.builtin.template:
template:
src: "{{ environment_path }}"
dest: /opt/conda-environments/{{ environment_path | basename }}
mode: "0644"
register: _environment

- name: Install conda environment {{ environment_path | basename }}
become: true
ansible.builtin.command:
cmd: "{{ miniforge_home }}/bin/mamba env update -f /opt/conda-environments/{{ environment_path | basename }} --prefix {{ miniforge_home }}/envs/{{ environment_path
command:
cmd:
"{{ miniforge_home }}/bin/mamba env update -f /opt/conda-environments/{{ environment_path | basename }} --prefix {{ miniforge_home }}/envs/{{ environment_path
| basename | splitext | first }}"
when: _environment.changed
Loading

0 comments on commit 3df5f22

Please sign in to comment.