tobiko/roles/tobiko-devstack/tasks/ensure-stack-user.yaml
Federico Ressi 07e593f829 Rewrite Vagrant file using ansible and Centos 8
Depends-On: Ifa876b3e5f89258f40055fa7ce03f5e9c601771c
Change-Id: I806c76bff85210f74cd23c29835f41c174b8c960
2020-06-23 11:47:17 +02:00

46 lines
879 B
YAML

---
- name: ensure /usr/local/bin is in sudo secure path
become: yes
lineinfile:
path: /etc/sudoers
regexp: 'secure_path'
line: 'Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin'
validate: '/usr/sbin/visudo -cf %s'
- name: ensure stack group exists
become: yes
group:
name: stack
state: present
- name: ensure stack user exists
become: yes
user:
name: stack
home: '{{ devstack_dest_dir }}'
comment: DevStack user
group: stack
shell: /bin/bash
- name: ensure stack user has sudo privileges
become: yes
copy:
dest: /etc/sudoers.d/stack
content: |
stack ALL=(ALL) NOPASSWD: ALL
- name: ensure stack user home exists
become: yes
become_user: root
file:
path: '{{ devstack_dest_dir | realpath }}'
state: directory
mode: '0755'
owner: stack
group: stack