%PDF- %PDF-
| Direktori : /proc/self/root/proc/self/root/proc/self/root/etc/ansible/roles/common/tasks/ |
| Current File : //proc/self/root/proc/self/root/proc/self/root/etc/ansible/roles/common/tasks/password.yml |
---
# change password for user on server
# login name and password are pass through file
- name: install shadow-utils
yum: pkg=shadow-utils state=present
tags: package
- name: check username
fail: msg="user is root"
when: "common_user == 'root'"
tags: bitrix_password
- name: create folder
file: path=/opt/webdir/keys state=directory recurse=yes
group=root owner=root mode=0700
tags: bitrix_password
- name: copy file to remote server
copy: src={{ common_file }} dest=/opt/webdir/keys/password_file
group=root owner=root mode=0600
tags: bitrix_password
- name: update password
shell: cat /opt/webdir/keys/password_file | chpasswd -c SHA256
tags: bitrix_password
- name: delete temporary file
file: path=/opt/webdir/keys/password_file state=absent
tags: bitrix_password
- name: delete local temporary file
delegate_to: localhost
file: path={{ common_file }} state=absent
tags: bitrix_password