kolla-ansible/ansible/roles/prechecks/tasks/user_checks.yml
Raimund Hook 84ea42bd7c Updating Jinja filters to conform to Ansible 2.5+
Since Ansible 2.5, the use of jinja tests as filters has been
deprecated.

I've run the script provided by the ansible team to 'fix' the
jinja filters to conform to the newer syntax.

This fixes the deprecation warnings.

Change-Id: I844ecb7bec94e561afb09580f58b1bf83a6d00bd
Closes-bug: #1827370
2019-05-02 14:58:09 +01:00

20 lines
474 B
YAML

---
- name: Check if config_owner_user existed
getent:
database: passwd
key: "{{ config_owner_user }}"
- name: Check if config_owner_group existed
getent:
database: group
key: "{{ config_owner_group }}"
register: getent_group
# NOTE(duonghq): it's only a basic check, should be refined later
- name: Check if ansible user can do passwordless sudo
shell: "true"
become: yes
register: result
failed_when: result is failed
changed_when: False