blob: 8f53f5d6f9250edc931bae3feab7016c5e75ad52 [file] [log] [blame]
Zack Williams79286962017-07-10 12:24:37 -07001---
2# create-configdirs-privileged/tasks/main.yml
3
4# This role exists to work around issues with the local scenario, which may not
5# necessarily be run by a user with become (sudo) rights, which causes these
6# director creation tasks to fail when `become: yes` is used.
7
8# become version of directory creation from `cord-profile` role
9- name: Create cord_profile directory, privileged
10 become: yes
11 file:
12 path: "{{ config_cord_profile_dir }}"
13 state: directory
14 mode: 0755
15 owner: "{{ ansible_user_id }}"
16 group: "{{ ansible_user_gid }}"
17
18# become version of directory creation from `pki-root-ca` role
19- name: Create PKI and credentials directories, privileged
20 become: yes
21 file:
22 dest: "{{ item }}"
23 state: directory
24 owner: "{{ ansible_user_id }}"
25 mode: 0700
26 with_items:
27 - "{{ credentials_dir }}"
28 - "{{ pki_dir }}"
29
30- name: Create root CA directory, privileged
31 become: yes
32 file:
33 dest: "{{ pki_dir }}/root_ca"
34 state: directory
35 owner: "{{ ansible_user_id }}"
36 mode: 0755
37
38# become version of directory creation from `pki-intermediate-ca` role
39- name: Create intermediate CA directory, privileged
40 become: yes
41 file:
42 dest: "{{ pki_dir }}/{{ site_name }}_im_ca"
43 state: directory
44 owner: "{{ ansible_user_id }}"
45 mode: 0755
46
47# become version of directory creation from `ssh-pki` role
48- name: Create SSH CA Directory
49 become: yes
50 file:
51 dest: "{{ item }}"
52 state: directory
53 owner: "{{ ansible_user_id }}"
54 mode: 0700
55 with_items:
56 - "{{ ssh_pki_dir }}"
57 - "{{ ssh_pki_dir }}/ca"
58 - "{{ ssh_pki_dir }}/client_certs"
59 - "{{ ssh_pki_dir }}/host_certs"
60
61