-
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.
- Loading branch information
Showing
25 changed files
with
105 additions
and
64 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,20 @@ | ||
# This file contains ignores rule violations for ansible-lint | ||
|
||
# These are very low level, so we keep their wrong names for now | ||
roles/base/defaults/main.yml var-naming[no-role-prefix] | ||
roles/core/defaults/main.yml var-naming[no-role-prefix] | ||
roles/files/defaults/main.yml var-naming[no-role-prefix] | ||
|
||
# This can probably be renamed without as much effort | ||
roles/git_clone/defaults/main.yml var-naming[no-role-prefix] | ||
|
||
# We should make this configurable and default to 644 | ||
roles/git_clone/tasks/main.yml risky-file-permissions | ||
|
||
# These should be fixed at some point | ||
roles/local_user/tasks/main.yml ignore-errors | ||
roles/local_user/tasks/main.yml no-changed-when | ||
|
||
# We should start writing changelogs at some point | ||
galaxy.yml galaxy[no-changelog] | ||
|
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,8 @@ | ||
--- | ||
exclude_paths: | ||
- .github/ | ||
- venv/ | ||
write_list: | ||
- all | ||
warn_list: | ||
- meta-runtime[unsupported-version] |
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
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
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 @@ | ||
requires_ansible: ">=2.11,<2.17" | ||
--- | ||
requires_ansible: ">=2.14,<2.17" |
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,8 @@ | ||
--- | ||
# defaults for radiorabe.common.base | ||
|
||
radiorabe_base_mail_noreply: 'noreply@{{ radiorabe_core_hostname }}' | ||
radiorabe_base_mail_noreply: "noreply@{{ radiorabe_core_hostname }}" | ||
|
||
radiorabe_base_foreman_host: 'foreman.service.{{ radiorabe_core_int_hostname }}' | ||
radiorabe_base_foreman_host: "foreman.service.{{ radiorabe_core_int_hostname }}" | ||
|
||
radiorabe_base_foreman_url: 'https://{{ radiorabe_base_foreman_host }}' | ||
radiorabe_base_foreman_url: "https://{{ radiorabe_base_foreman_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
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,11 +1,12 @@ | ||
--- | ||
# defaults for radiorabe.common.core | ||
|
||
radiorabe_core_hostname: 'rabe.ch' | ||
radiorabe_core_hostname: "rabe.ch" | ||
|
||
radiorabe_core_int_hostname: 'int.{{ radiorabe_core_hostname }}' | ||
radiorabe_core_int_hostname: "int.{{ radiorabe_core_hostname }}" | ||
|
||
radiorabe_core_realm: '{{ radiorabe_core_int_hostname | upper }}' | ||
radiorabe_core_realm: "{{ radiorabe_core_int_hostname | upper }}" | ||
|
||
radiorabe_core_admin_name: 'RaBe IT-Reaktion' | ||
radiorabe_core_admin_name: "RaBe IT-Reaktion" | ||
|
||
radiorabe_core_admin_mail: 'it@{{ radiorabe_core_hostname }}' | ||
radiorabe_core_admin_mail: "it@{{ radiorabe_core_hostname }}" |
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
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
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,5 +1,6 @@ | ||
--- | ||
- hosts: localhost | ||
- name: Test download_file role | ||
hosts: localhost | ||
remote_user: root | ||
roles: | ||
- download_file |
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 @@ | ||
--- | ||
# defaults for radiorabe.common.file | ||
|
||
radiorabe_files: [] | ||
|
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,10 +1,10 @@ | ||
--- | ||
# tasks file for radiorabe.common.files | ||
|
||
- name: 'RaBe Base : File : Manage files' | ||
ansible.builtin.file: '{{ item }}' | ||
with_items: '{{ radiorabe_files }}' | ||
- name: "RaBe Base : File : Manage files" | ||
ansible.builtin.file: "{{ item }}" # noqa: args | ||
with_items: "{{ radiorabe_files }}" | ||
|
||
- name: 'RaBe Base : File : Copy files' | ||
ansible.builtin.copy: '{{ item }}' | ||
with_items: '{{ radiorabe_copies }}' | ||
- name: "RaBe Base : File : Copy files" | ||
ansible.builtin.copy: "{{ item }}" # noqa: risky-file-permissions | ||
with_items: "{{ radiorabe_copies }}" |
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,5 +1,6 @@ | ||
--- | ||
# defaults for radiorabe.common.git | ||
|
||
radiorabe_git_clone: [] | ||
radiorabe_git_local_clone: false | ||
radiorabe_git_clone_remote_dest: '' | ||
radiorabe_git_clone_remote_dest: "" |
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,14 +1,14 @@ | ||
--- | ||
# tasks file for radiorabe.common.git | ||
|
||
- name: "RaBe Common : git_clone : Clone git repository {{ 'locally' if radiorabe_git_local_clone else 'on remote host'}}" | ||
ansible.builtin.git: '{{ item }}' | ||
with_items: '{{ radiorabe_git_clone }}' | ||
- name: "RaBe Common : git_clone : Clone git repository {{ 'locally' if radiorabe_git_local_clone else 'on remote host' }}" | ||
ansible.builtin.git: "{{ item }}" # noqa: latest args | ||
with_items: "{{ radiorabe_git_clone }}" | ||
delegate_to: "{{ '127.0.0.1' if radiorabe_git_local_clone else omit }}" | ||
|
||
- name: 'RaBe Common : git_clone : Copy files to remote' | ||
ansible.builtin.copy: | ||
src: '{{ item.dest }}/' | ||
dest: '{{ radiorabe_git_clone_remote_dest }}/' | ||
with_items: '{{ radiorabe_git_clone }}' | ||
when: radiorabe_git_local_clone == true | ||
- name: "RaBe Common : git_clone : Copy files to remote" | ||
ansible.builtin.copy: | ||
src: "{{ item.dest }}/" | ||
dest: "{{ radiorabe_git_clone_remote_dest }}/" | ||
with_items: "{{ radiorabe_git_clone }}" | ||
when: radiorabe_git_local_clone |
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,9 @@ | ||
--- | ||
# defaults for radiorabe.common.local_user | ||
|
||
local_user_additional_groups: '' | ||
local_user_additional_groups: "" | ||
local_user_create_home: false | ||
local_user_groupname: '' | ||
local_user_home_directory: '' | ||
local_user_shell: '' | ||
local_user_groupname: "" | ||
local_user_home_directory: "" | ||
local_user_shell: "" | ||
local_user_system: false |
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,51 +1,46 @@ | ||
--- | ||
# tasks file for radiorabe.common.local_user | ||
|
||
- name: 'Get {{ local_user_username }} user info' | ||
- name: "Get user info for {{ local_user_username }}" | ||
ansible.builtin.getent: | ||
database: passwd | ||
key: '{{ local_user_username }}' | ||
key: "{{ local_user_username }}" | ||
ignore_errors: true | ||
|
||
- name: 'Get {{ local_user_groupname }} group' | ||
- name: "Get group info for {{ local_user_groupname }}" | ||
ansible.builtin.getent: | ||
database: group | ||
key: '{{ local_user_groupname }}' | ||
key: "{{ local_user_groupname }}" | ||
ignore_errors: true | ||
|
||
- name: 'Add group when does not exist' | ||
- name: "Add group when does not exist" | ||
become: true | ||
command: groupadd {{ local_user_groupname }} | ||
when: | ||
ansible_facts.getent_group is undefined and | ||
local_user_groupname != '' | ||
ansible.builtin.command: groupadd {{ local_user_groupname }} | ||
when: ansible_facts.getent_group is undefined and local_user_groupname != '' | ||
|
||
- name: 'Add user and group when does not exist' | ||
- name: "Add user and group when does not exist" | ||
become: true | ||
ansible.builtin.command: | ||
argv: "{{ cmd_argv | | ||
zip(cmd_argv_switch) | | ||
selectattr('1') | | ||
map(attribute='0') | list }}" | ||
argv: "{{ cmd_argv | zip(cmd_argv_switch) | selectattr('1') | map(attribute='0') | list }}" | ||
vars: | ||
cmd_argv: | ||
- 'useradd' | ||
- '--create-home' | ||
- "useradd" | ||
- "--create-home" | ||
- '--groups="{{ local_user_additional_groups }}"' | ||
- '--gid="{{ local_user_groupname }}"' | ||
- '--home-dir="{{ local_user_home_directory }}"' | ||
- '--shell="{{ local_user_shell }}"' | ||
- '--system' | ||
- '--add-subids-for-system' | ||
- '{{ local_user_username }}' | ||
- "--system" | ||
- "--add-subids-for-system" | ||
- "{{ local_user_username }}" | ||
cmd_argv_switch: | ||
- true | ||
- '{{ local_user_create_home }}' | ||
- "{{ local_user_create_home }}" | ||
- '{{ local_user_additional_groups != "" }}' | ||
- '{{ local_user_groupname != "" }}' | ||
- '{{ local_user_home_directory != "" }}' | ||
- '{{ local_user_shell != "" }}' | ||
- '{{ local_user_system }}' | ||
- '{{ local_user_system }}' | ||
- "{{ local_user_system }}" | ||
- "{{ local_user_system }}" | ||
- true | ||
when: ansible_facts.getent_passwd is undefined |