robertdebock / ansible-role-bootstrap

Prepare your system to be managed by Ansible.
https://robertdebock.nl/
Apache License 2.0
200 stars 57 forks source link

No real idempotence #23

Closed rembik closed 5 years ago

rembik commented 5 years ago

Describe the bug No real idempotence as described here.

To Reproduce Steps to reproduce the behavior:

---
- name: Idempotence
  hosts: all
  gather_facts: false
  become: no
  vars:
    ansible_user: admin

  roles:
    - role: bootstrap
    - role: users
      vars:
        users:
          - name: admin
            comment: Ansible Management User
            uid: 2000
            cron: yes
            sudo: yes
            ssh_key:
              - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDVpUJQCOaPg3p5xro9e+1fkGRWNOGrrExiKMqTE91Fwu349bxfMnMzRS0PAERouR9EEL+Ee4Yzhav/uNc35eCtXzACtluXnAncMrQj6pM3IqASynhvXTygHljmcMbBSDQtLrTZeW+YzIcOgk5UM1yBi26WoUYva2aCr9IRvKdYreAK08OiMdZedpOye0ZdvIYJGcyITwc6YMmrAhP7jZlrk/mDEkf2a4eBp+475o7MJtaC9npqYkToM8vqvx5AGEKqXt7/f1/paOY7KsR+VGPQy6k2RkXjWBsXPesZ3d3XLZHE60wAk0EsuJO8A25+uWSB6ILQeRSYYmGea/WIf6kd noone@throwaway.example.com"
            generate_ssh_key: yes

Expected behavior No connection errors.

Error Connection errors.

Environment

Additional context None.

rembik commented 5 years ago

Dont get me wrong. I love the way you handle the testing and maintaining of your roles. Also your role works in most cases, but when you combine this role with further roles to accomblish real scenarios you either play the bootstrap roles separate from the further tasks or use the bootstrap user (in most cases root!) for connecting in future plays.

I hope you get the point, why I prefer the support for savely combining bootstrap tasks and further tasks in one playbook. :)

robertdebock commented 5 years ago

Fixed with the latest release, thanks for your help.