Replace periods in username with underscores

Fixing the conflict and sending a new pull request

Fixes #118
Duplicate of #120
This commit is contained in:
Ashok Raja 2017-06-16 13:18:18 +05:30
parent 00fc0c2d33
commit 9c6e829e1e
1 changed files with 7 additions and 6 deletions

View File

@ -354,12 +354,13 @@ users_ssh_known_hosts_delete_{{ name }}_{{ loop.index0 }}:
{% endfor %} {% endfor %}
{% endif %} {% endif %}
{% set sudoers_d_filename = name|replace('.','_') %}
{% if 'sudouser' in user and user['sudouser'] %} {% if 'sudouser' in user and user['sudouser'] %}
users_sudoer-{{ name }}: users_sudoer-{{ name }}:
file.managed: file.managed:
- replace: False - replace: False
- name: {{ users.sudoers_dir }}/{{ name }} - name: {{ users.sudoers_dir }}/{{ sudoers_d_filename }}
- user: root - user: root
- group: {{ users.root_group }} - group: {{ users.root_group }}
- mode: '0440' - mode: '0440'
@ -398,7 +399,7 @@ users_sudoer-{{ name }}:
users_{{ users.sudoers_dir }}/{{ name }}: users_{{ users.sudoers_dir }}/{{ name }}:
file.managed: file.managed:
- replace: True - replace: True
- name: {{ users.sudoers_dir }}/{{ name }} - name: {{ users.sudoers_dir }}/{{ sudoers_d_filename }}
- contents: | - contents: |
{%- if 'sudo_defaults' in user %} {%- if 'sudo_defaults' in user %}
{%- for entry in user['sudo_defaults'] %} {%- for entry in user['sudo_defaults'] %}
@ -419,14 +420,14 @@ users_{{ users.sudoers_dir }}/{{ name }}:
- file: users_sudoer-defaults - file: users_sudoer-defaults
- file: users_sudoer-{{ name }} - file: users_sudoer-{{ name }}
cmd.wait: cmd.wait:
- name: visudo -cf {{ users.sudoers_dir }}/{{ name }} || ( rm -rvf {{ users.sudoers_dir }}/{{ name }}; exit 1 ) - name: visudo -cf {{ users.sudoers_dir }}/{{ sudoers_d_filename }} || ( rm -rvf {{ users.sudoers_dir }}/{{ sudoers_d_filename }}; exit 1 )
- watch: - watch:
- file: {{ users.sudoers_dir }}/{{ name }} - file: {{ users.sudoers_dir }}/{{ sudoers_d_filename }}
{% endif %} {% endif %}
{% else %} {% else %}
users_{{ users.sudoers_dir }}/{{ name }}: users_{{ users.sudoers_dir }}/{{ sudoers_d_filename }}:
file.absent: file.absent:
- name: {{ users.sudoers_dir }}/{{ name }} - name: {{ users.sudoers_dir }}/{{ sudoers_d_filename }}
{% endif %} {% endif %}
{%- if 'google_auth' in user %} {%- if 'google_auth' in user %}