--- - name: Create Ansible User hosts: ORA_SERVER tasks: - name: Create Ansible User ansible.builtin.user: name: ansible groups: "{{ admin_group }}" append: true create_home: true comment: "Ansible Management Account" expires: -1 password: "{{ management_user_pwd | password_hash('sha512','A512') }}" - name: Deploy Local User SSH Key authorized_key: user: ansible state: present manage_dir: true key: "{{ lookup('file', '/home/ansible/.ssh/id_rsa.pub') }}" - name: Setup Sudo Access for Devops User ansible.builtin.copy: dest: /etc/sudoers.d/ansible content: 'ansible ALL = NOPASSWD : ALL' validate: /usr/sbin/visudo -cf %s