Ansible password setup in user module. It didn't set properly

ساخت وبلاگ

Vote count: 0

I'm new in ansible, I'm setting up my new instance in digitalocean for configuring new user. Basically, I have the playbook for setting up it and everythings okay when I run the playbook but when I tried to check if my password is working it didn't work.

I did the

sudo apt-get update

to if the password is working. It didn't.

---
- name: Configure Server hosts: sample_server gather_facts: no remote_user: root vars: useame: sample_user password: sample_password tasks: - name: Update apt cache apt: update_cache=yes - name: Safe aptitude upgrade apt: upgrade=safe async: 600 poll: 5 - name: Add my user user: name: "{{ useame }}" password: "{{ password }}" update_password: always shell: /bin/bash groups: sudo append: yes generate_ssh_key: yes ssh_key_bits: 2048 state: present - name: Add my workstation user's public key to the new user authorized_key: user: "{{ useame }}" key: "{{ lookup('file', 'certificates/id_rsa.pub') }}" state: present - name: Change SSH port lineinfile: dest: /etc/ssh/sshd_config regexp: "^Port" line: "Port 30000" state: present # notify: # - Restart SSH - name: Remove root SSH access lineinfile: dest: /etc/ssh/sshd_config regexp: "^PermitRootLogin" line: "PermitRootLogin no" state: present # notify: # - Restart SSH - name: Remove password SSH access lineinfile: dest: /etc/ssh/sshd_config regexp: "^PasswordAuthentication" line: "PasswordAuthentication no" state: present # notify: # - Restart SSH - name: Reboot the server service: name=ssh state=restarted handlers: - name: Restart SSH service: name=ssh state=restarted

Any idea for this. Thanks

asked 2 mins ago

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : نویسنده : استخدام کار backsoft بازدید : 147 تاريخ : يکشنبه 26 ارديبهشت 1395 ساعت: 10:11