Role - tripleo-create-admin

Role Documentation

Welcome to the “tripleo_create_admin” role documentation.

Role Defaults

This section highlights all of the defaults and variables set within the “tripleo_create_admin” role.

# All variables intended for modification should be placed in this file.

# Set the default admin user
tripleo_admin_user: tripleo-admin

# Enable or disable key generation for the defined user
tripleo_admin_generate_key: false

# When `tripleo_admin_pubkey` is defined an additional authorized key will
# added to the admin users authroized_keys file.
#   tripleo_admin_pubkey: ssh-rsa AAAA...

# When `tripleo_admin_prikey` is defined and not empty and when
# distribute_private_key is true, then a private key will
# be added to the admin user's home dir. It will be called
# "~/.ssh/id_rsa" and contain something like:
#   tripleo_admin_prikey: -----BEGIN OPENSSH PRIVATE KEY-----\nb3B...

distribute_private_key: false

Molecule Scenarios

Molecule is being used to test the “tripleo_create_admin” role. The following section highlights the drivers in service and provides an example playbook showing how the role is leveraged.

Scenario: keygen

Driver: podman
Molecule Inventory
hosts:
  all:
    hosts:
      centos:
        ansible_python_interpreter: /usr/bin/python3
Example keygen playbook
- name: Converge
  hosts: all
  roles:
  - role: tripleo_create_admin
    tripleo_admin_generate_key: true

Scenario: default

Driver: podman
Molecule Inventory
hosts:
  all:
    hosts:
      centos:
        ansible_python_interpreter: /usr/bin/python3
Example default playbook
- name: Converge
  hosts: all
  roles:
  - role: tripleo_create_admin

Scenario: addkey

Driver: podman
Molecule Inventory
hosts:
  all:
    hosts:
      centos:
        ansible_python_interpreter: /usr/bin/python3
Example addkey playbook
- name: Converge
  hosts: all
  roles:
  - role: tripleo_create_admin
  post_tasks:
  - import_role:
      name: tripleo_create_admin
      tasks_from: authorize_user.yml
    vars:
      tripleo_admin_user: tripleo-admin
      tripleo_admin_pubkey: ssh-rsa AAAATEST

  - import_role:
      name: tripleo_create_admin
      tasks_from: distribute_key_files.yml
    vars:
      tripleo_admin_user: tripleo-admin
      distribute_private_key: true
      tripleo_admin_prikey: '-----BEGIN OPENSSH PRIVATE KEY-----'