Reviewing playbooks and roles

Let's jump right into examining the roles we created.

The completed role and file, named main.yml, located in the config-admin-region/tasks directory, looks like this:

--- - name: Create users os_user: cloud: "{{CLOUD_NAME}}" state: present name: "{{ item.0 }}" password: "{{ item.1 }}" default_project: "{{ servicesproject }}" domain: default with_together: - "{{userid}}" - "{{passwdss}}" - name: Assign user to specified role in designated environment os_user_role: cloud: "{{CLOUD_NAME}}" user: "{{ item.0 }}" role: "{{ urole }}" project: "{{ servicesproject }}" with_together: - "{{userid}}" - name: Register the new services on the Admin region shell: openstack --os-cloud="{{ CLOUD_NAME }}" service create --name "{{ item.0 ...

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.