To get started, we can start from the top with the role we created called create-users-env
. The completed role and file named main.yml
is located in the create-users-env/tasks
directory, which 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 command: keystone --os-username={{ OS_USERNAME }} --os-password={{ OS_PASSWORD }} --os-tenant-name={{ OS_TENANT_NAME }} --os-auth-url={{ OS_AUTH_URL }} user-create --name={{ item.0 }} --pass={{ item.1 }} with_together: - userid - passwdss.stdout_lines - name: Create user environments command: keystone --os-username={{ OS_USERNAME }} --os-password={{ OS_PASSWORD }} --os-tenant-name={{ OS_TENANT_NAME }} --os-auth-url={{ OS_AUTH_URL }} tenant-create --name={{ item }} --description="{{ item...