Reviewing playbooks and roles

To get right to it, we can start from the top with the role we created named create-users-env. The completed role and file named main.yml located in the create-users-env/tasks directory looks like this:

--- - name: Install random password generator package apt: name={{item}} state=present with_items: - apg - name: Random generate passwords command: apg -n {{ pass_cnt }} -M NCL -q register: passwdss - name: Create users os_user: cloud: "{{CLOUD_NAME}}" state: present name: "{{ item.0 }}" password: "{{ item.1 }}" domain: default with_together: - "{{userid}}" - "{{passwdss.stdout_lines}}" - name: Create user environments os_project: cloud: "{{CLOUD_NAME}}" state: present name: "{{ item }}" description: "{{ item }}" domain_id: ...

Get OpenStack Administration with Ansible 2 - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.