Skip to content
Snippets Groups Projects
Commit 06909679 authored by jurgenhaas's avatar jurgenhaas
Browse files

ansible-playbooks/general#85 Linting

parent 8f0d766a
No related branches found
No related tags found
No related merge requests found
tunnel_user_name: 'systunnel'
tunnel_user_name: systunnel
jailusers: []
initial_password: 'a4q7nsYju.N4I'
initial_password: a4q7nsYju.N4I
# created with:
# python -c 'import crypt; print crypt.crypt("My First Password", "a4$6dZ8$FngnTn$x")'
# or:
......
......@@ -3,14 +3,15 @@
- block:
- name: "Create Jail Group"
- name: Create Jail Group
group:
name: '{{ drupal.jail.name }}'
when: drupal.jail is defined and drupal.jail.name is defined
- name: "Create Git Group"
- name: Create Git Group
group:
name: '{{ drupal.src.name }}'
when: drupal.src is defined and drupal.src.name is defined
tags: 'SetPermissions'
tags:
- SetPermissions
......@@ -3,19 +3,19 @@
- block:
- name: "Create User"
- name: Create User
user:
name: '{{ username }}'
group: 'root'
group: root
groups: "{{ users[username].groups|default('www-data') }}"
append: '{{ append }}'
home: '/home/{{ username }}'
home: /home/{{ username }}
generate_ssh_key: yes
ssh_key_bits: 2048
password: '{{ initial_password }}'
update_password: 'on_create'
update_password: on_create
- name: "Add User to Jail Group"
- name: Add User to Jail Group
user:
name: '{{ username }}'
groups: '{{ item.jail.name }}'
......@@ -23,7 +23,7 @@
with_items: '{{ drupal_settings|default([]) }}'
when: item.jail is defined and item.jail.users is defined and item.jail.name is defined and (username in item.jail.users or username in admins)
- name: "Add User to Git Group"
- name: Add User to Git Group
user:
name: '{{ username }}'
groups: '{{ item.src.name }}'
......@@ -31,4 +31,5 @@
with_items: '{{ drupal_settings|default([]) }}'
when: item.src is defined and item.src.users is defined and item.src.name is defined and (username in item.src.users)
tags: 'SetPermissions'
tags:
- SetPermissions
---
# file: roles/commonauth/tasks/main.yml
- name: "Common Auth Role"
- name: Common Auth Role
set_fact:
role_commonauth_started: true
tags: 'always'
tags:
- always
- block:
- name: "Set default facts"
- name: Set default facts
set_fact:
append: yes
tags: 'always'
tags:
- always
- name: "Set reset facts"
- name: Set reset facts
set_fact:
append: no
tags: 'Reset'
tags:
- Reset
- name: "Init Gropus"
include_tasks: 'initgroups.yml'
- name: Init Gropus
include_tasks: initgroups.yml
with_items: '{{ drupal_settings|default([]) }}'
loop_control:
loop_var: drupal
tags:
- 'SetPermissions'
- SetPermissions
- name: "Init Users"
include_tasks: 'inituser.yml'
- name: Init Users
include_tasks: inituser.yml
with_flattened:
- '{{ admins }}'
- '{{ jailusers }}'
- {{ admins }}
- {{ jailusers }}
loop_control:
loop_var: username
tags:
- 'SetPermissions'
- SetPermissions
- name: "Ensure Extra Users"
- name: Ensure Extra Users
user:
name: '{{ item.username }}'
with_items: '{{ auth_keys|default([]) }}'
tags: 'Keys'
tags:
- Keys
- name: "Install Public Key For Extra Users"
- name: Install Public Key For Extra Users
authorized_key:
user: '{{ item.username }}'
key: "{{ lookup('file', inventory_dir + '/files/keys/' + item.keyname + '.d2s.pub') }}"
with_items: '{{ auth_keys|default([]) }}'
tags: 'Keys'
tags:
- Keys
- name: 'Remember that this role had been run'
- name: Remember that this role had been run
set_fact:
role_commonauth_completed: true
tags: 'always'
tags:
- always
when: '"commonauth" not in excluded_roles and role_commonauth_completed is not defined'
when: not excluded_roles or "commonauth" not in excluded_roles and role_commonauth_completed is not defined
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment