O'Reilly logo

OpenStack Administration with Ansible 2 - Second Edition by Walter Bentley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required