-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #144 from nebari-dev/lint
Add linting for ansible
- Loading branch information
Showing
95 changed files
with
2,731 additions
and
2,699 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
# .ansible-lint | ||
|
||
skip_list: | ||
- var-naming | ||
- package-latest | ||
- yaml[line-length] | ||
- risky-file-permissions | ||
- no-changed-when | ||
- no-handler | ||
- risky-octal | ||
- args[module] |
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 @@ | ||
--- | ||
name: Ansible Lint | ||
|
||
on: | ||
push: | ||
pull_request: | ||
jobs: | ||
build: | ||
name: Ansible Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Run ansible-lint | ||
uses: ansible/ansible-lint@main |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
--- | ||
# Any additional users and groups you would like added to all nodes | ||
enabled_users: | ||
- username: example-user | ||
|
@@ -6,7 +7,7 @@ enabled_users: | |
email: [email protected] | ||
# mkpasswd --method=sha-512 | ||
# password: example-user | ||
password: "$6$3aaf4gr8D$2T31r9/GtXM6rVY8oHOejn.sThwhBZehbPZC.ZkN0XJOZUuguR9VnRQRYmqYAt9eW3LgLR21q1kbqSYSEDm5U." | ||
password: $6$3aaf4gr8D$2T31r9/GtXM6rVY8oHOejn.sThwhBZehbPZC.ZkN0XJOZUuguR9VnRQRYmqYAt9eW3LgLR21q1kbqSYSEDm5U. | ||
primary_group: example-user | ||
groups: | ||
- users | ||
|
@@ -24,9 +25,9 @@ munge_key: eC36WeTj1JKUGyQEcfqkaRO0fDBoyTVHnkn7kE5sOZ1YUYyqWMSp3qeRZEmtEX9B | |
|
||
openldap_bind_password: EsicntiZOhQaGomPiJZLWJEJ | ||
|
||
jupyterhub_client_secret: "SUPERSECRETPASSWORDJUPYTERHUB" | ||
conda_store_client_secret: "SUPERSECRETPASSWORDCONDASTORE" | ||
grafana_client_secret: "SUPERSECRETPASSWORDGRAFANA" | ||
jupyterhub_client_secret: SUPERSECRETPASSWORDJUPYTERHUB | ||
conda_store_client_secret: SUPERSECRETPASSWORDCONDASTORE | ||
grafana_client_secret: SUPERSECRETPASSWORDGRAFANA | ||
|
||
minio_password: mWdaGyPmNOApU93Vxk6sNTac | ||
keycloak_admin_password: XLWUMUu8OG0XqlMREZK9id9o | ||
|
@@ -45,4 +46,4 @@ mysql_users: | |
postgres_users: | ||
- username: conda-store | ||
password: eIbmUditL4RbQm0YPeLozRme | ||
role: 'CREATEDB,CREATEROLE' | ||
role: CREATEDB,CREATEROLE |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
--- | ||
dask_gateway_client_enabled: true | ||
firewall_enabled: true | ||
ipyparallel_enabled: true | ||
|
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 |
---|---|---|
@@ -1,56 +1,58 @@ | ||
--- | ||
- hosts: all | ||
pre_tasks: | ||
- name: Gather facts from ALL hosts (regardless of limit or tags) | ||
setup: | ||
delegate_to: "{{ item }}" | ||
delegate_facts: True | ||
when: hostvars[item]['ansible_default_ipv4'] is not defined | ||
with_items: "{{ groups['all'] }}" | ||
- name: Copy files | ||
include_tasks: tasks/copy_files.yaml | ||
loop: '{{ ["all"] + group_names + [inventory_hostname_short] }}' | ||
loop_control: | ||
loop_var: myhost | ||
- name: Setup Nebari Slurm | ||
hosts: all | ||
pre_tasks: | ||
- name: Gather facts from ALL hosts (regardless of limit or tags) | ||
ansible.builtin.setup: | ||
delegate_to: "{{ item }}" | ||
delegate_facts: true | ||
when: hostvars[item]['ansible_default_ipv4'] is not defined | ||
with_items: "{{ groups['all'] }}" | ||
- name: Copy files | ||
ansible.builtin.include_tasks: tasks/copy_files.yaml | ||
loop: '{{ ["all"] + group_names + [inventory_hostname_short] }}' | ||
loop_control: | ||
loop_var: myhost | ||
|
||
roles: | ||
# core services | ||
- hosts | ||
- firewall | ||
- accounts | ||
- apt_packages | ||
- miniforge | ||
- cifs | ||
- nfs | ||
- mysql | ||
- postgresql | ||
- minio | ||
- backups | ||
- traefik | ||
- openldap | ||
- keycloak | ||
# workflows | ||
- slurm | ||
# monitoring | ||
- prometheus | ||
- grafana | ||
# data-science services | ||
- conda_store | ||
- jupyterhub | ||
- dask_gateway | ||
- ipyparallel | ||
# plugins | ||
- bodo | ||
roles: | ||
# core services | ||
- hosts | ||
- firewall | ||
- accounts | ||
- apt_packages | ||
- miniforge | ||
- cifs | ||
- nfs | ||
- mysql | ||
- postgresql | ||
- minio | ||
- backups | ||
- traefik | ||
- openldap | ||
- keycloak | ||
# workflows | ||
- slurm | ||
# monitoring | ||
- prometheus | ||
- grafana | ||
# data-science services | ||
- conda_store | ||
- jupyterhub | ||
- dask_gateway | ||
- ipyparallel | ||
# plugins | ||
- bodo | ||
|
||
tasks: | ||
- name: Additional ansible tasks | ||
include_tasks: "{{ item }}" | ||
with_items: "{{ additional_tasks | default([]) }}" | ||
tasks: | ||
- name: Additional ansible tasks | ||
ansible.builtin.include_tasks: "{{ item }}" | ||
with_items: "{{ additional_tasks | default([]) }}" | ||
|
||
- name: Keycloak administration credentials | ||
ansible.builtin.debug: | ||
msg: "Keycloak administration username={{ keycloak_admin_username }} via https://{{ traefik_domain | default(hostvars[groups['hpc_master'][0]].ansible_ssh_host) }}/auth/admin/" | ||
- name: Keycloak administration credentials | ||
ansible.builtin.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 | ||
ansible.builtin.debug: | ||
msg: "Access cluster via following url: https://{{ traefik_domain | default(hostvars[groups['hpc_master'][0]].ansible_ssh_host) }}" | ||
- name: Accessing cluster | ||
ansible.builtin.debug: | ||
msg: "Access cluster via following url: https://{{ traefik_domain | default(hostvars[groups['hpc_master'][0]].ansible_ssh_host) }}" |
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 |
---|---|---|
@@ -1,8 +1,5 @@ | ||
--- | ||
enabled_users: [] | ||
|
||
enabled_groups: [] | ||
|
||
disabled_users: [] | ||
|
||
disabled_groups: [] |
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 |
---|---|---|
@@ -1,38 +1,38 @@ | ||
--- | ||
- name: Ensure groups are present | ||
become: true | ||
group: | ||
name: "{{ item.name }}" | ||
gid: "{{ item.gid }}" | ||
state: present | ||
with_items: "{{ enabled_groups }}" | ||
- name: Ensure groups are present | ||
become: true | ||
ansible.builtin.group: | ||
name: "{{ item.name }}" | ||
gid: "{{ item.gid }}" | ||
state: present | ||
with_items: "{{ enabled_groups }}" | ||
|
||
- name: Ensure users are present | ||
become: true | ||
user: | ||
name: "{{ item.username }}" | ||
uid: "{{ item.uid }}" | ||
shell: /bin/bash | ||
createhome: true | ||
generate_ssh_key: false | ||
comment: "{{ item.fullname }},,,,{{ item.email }}" | ||
group: "{{ item.primary_group | default(omit) }}" | ||
groups: "{{ item.groups | default(omit) }}" | ||
password: "{{ item.password | default(omit) }}" | ||
home: /home/{{ item.username }} | ||
state: present | ||
with_items: "{{ enabled_users }}" | ||
- name: Ensure users are present | ||
become: true | ||
ansible.builtin.user: | ||
name: "{{ item.username }}" | ||
uid: "{{ item.uid }}" | ||
shell: /bin/bash | ||
createhome: true | ||
generate_ssh_key: false | ||
comment: "{{ item.fullname }},,,,{{ item.email }}" | ||
group: "{{ item.primary_group | default(omit) }}" | ||
groups: "{{ item.groups | default(omit) }}" | ||
password: "{{ item.password | default(omit) }}" | ||
home: /home/{{ item.username }} | ||
state: present | ||
with_items: "{{ enabled_users }}" | ||
|
||
- name: Ensure users are disabled | ||
become: true | ||
user: | ||
name: "{{ item }}" | ||
state: absent | ||
with_items: "{{ disabled_users }}" | ||
- name: Ensure users are disabled | ||
become: true | ||
ansible.builtin.user: | ||
name: "{{ item }}" | ||
state: absent | ||
with_items: "{{ disabled_users }}" | ||
|
||
- name: Ensure groups are disabled | ||
become: true | ||
group: | ||
name: "{{ item }}" | ||
state: absent | ||
with_items: "{{ disabled_groups }}" | ||
- name: Ensure groups are disabled | ||
become: true | ||
ansible.builtin.group: | ||
name: "{{ item }}" | ||
state: absent | ||
with_items: "{{ disabled_groups }}" |
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
--- | ||
installed_packages: [] |
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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
--- | ||
- name: Ensure apt packages are installed | ||
become: true | ||
apt: | ||
name: "{{ installed_packages }}" | ||
state: latest | ||
update_cache: yes | ||
cache_valid_time: 3600 | ||
- name: Ensure apt packages are installed | ||
become: true | ||
ansible.builtin.apt: | ||
name: "{{ installed_packages }}" | ||
state: latest | ||
update_cache: true | ||
cache_valid_time: 3600 |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
--- | ||
backup_enabled: false | ||
backup_on_calendar: "daily" | ||
backup_on_calendar: daily | ||
backup_randomized_delay: "3600" | ||
backup_environment: | ||
RESTIC_REPOSITORY: ... | ||
RESTIC_PASSWORD: ... | ||
RESTIC_REPOSITORY: "..." | ||
RESTIC_PASSWORD: "..." |
Oops, something went wrong.