*** Wartungsfenster jeden ersten Mittwoch vormittag im Monat ***

Skip to content
Snippets Groups Projects
Verified Commit fbc4359b authored by Weise, Martin's avatar Weise, Martin
Browse files

Create an account works

parent 8ca045ab
No related branches found
No related tags found
1 merge request!11Allow for the sysadmin to access the provider network, added the ui support...
...@@ -32,11 +32,7 @@ ...@@ -32,11 +32,7 @@
when: item is undefined when: item is undefined
with_items: with_items:
- "{{ username }}" - "{{ username }}"
- "{{ fullname }}"
- "{{ email }}"
- "{{ phone }}"
- "{{ role_type }}" - "{{ role_type }}"
- "{{ pubkey }}"
delegate_to: 127.0.0.1 delegate_to: 127.0.0.1
- name: Check role - name: Check role
...@@ -49,14 +45,42 @@ ...@@ -49,14 +45,42 @@
- hosts: proidentity - hosts: proidentity
vars_files: vars_files:
- vars/auth.yml - vars/auth.yml
roles: - vars/secure.yml
- user_duplicate vars_prompt:
- name: first
prompt: First name of the user account?
private: no
- name: last
prompt: Last name of the user account?
private: no
- name: email
prompt: E-Mail of the user account?
private: no
- name: phone
prompt: Phone of the user account?
private: no
- name: pubkey
prompt: Absolute path to the public key of the user account?
private: no
tasks:
- name: Authenticate
shell: "echo '{{ idp_adm_passwd }}' | kinit admin"
- name: Configure identities
block:
- name: Create account
command: ipa user-add {{ username }} --first="{{ first }}" --last="{{ last }}" --email="{{ email }}" --phone="{{ phone }}" --sshpubkey="{{ lookup('file', pubkey) }}" --random
register: ipa_result
- set_fact:
random_passwd: "{{ ipa_result.stdout | regex_search(regexp,'\\1') }}"
vars:
regexp: '.*Random password: ([^\n]+)'
- hosts: proidentity
vars_files:
- vars/auth.yml
roles:
- user_identity_save
# VPN PROFILE # VPN PROFILE
...@@ -69,5 +93,18 @@ ...@@ -69,5 +93,18 @@
# SUMMARY # SUMMARY
- hosts: proidentity - hosts: proidentity
roles: tasks:
- user_info - name: Account information
block:
- name: Print
debug:
msg:
- "Credentials:"
- ""
- " Username: {{ username }}"
- " Password: {{ random_passwd }}"
- ""
- "The OpenVPN profile is located at /tmp/{{ username }}.ovpn on this computer"
- name: Clean up
meta: clear_facts
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
tasks: tasks:
- name: Authenticate - name: Authenticate
shell: "echo '{{ idp_adm_passwd }}' | kinit admin" shell: "echo '{{ idp_adm_passwd }}' | kinit admin"
no_log: true
- name: Configure default shell - name: Configure default shell
command: ipa config-mod --defaultshell=/bin/bash command: ipa config-mod --defaultshell=/bin/bash
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment