41 lines
868 B
YAML
41 lines
868 B
YAML
|
---
|
||
|
- name: maintain okta users
|
||
|
hosts: localhost
|
||
|
vars_files:
|
||
|
- okta_vars.yml
|
||
|
|
||
|
vars:
|
||
|
first_name: API
|
||
|
last_name: Test
|
||
|
email: "{{ email_deleteme }}"
|
||
|
login: "{{ email_deleteme }}"
|
||
|
isActive: True
|
||
|
|
||
|
tasks:
|
||
|
- name: Check for {{ login }}
|
||
|
okta_users:
|
||
|
organization: "{{ org }}"
|
||
|
api_key: "{{ api }}"
|
||
|
action: list
|
||
|
login: "{{ login }}"
|
||
|
register: oktalist
|
||
|
|
||
|
- name: debug
|
||
|
debug:
|
||
|
msg: "{{ oktalist }}"
|
||
|
|
||
|
|
||
|
|
||
|
# if the account is not found, make it
|
||
|
#- name: Create {{ login }}
|
||
|
# okta_users:
|
||
|
## organization: "{{ organization }}"
|
||
|
# api_key: "{{ api_key }}"
|
||
|
# action: create
|
||
|
# login: "{{ login }}"
|
||
|
# email: "{{ email }}"
|
||
|
# first_name: "{{ first_name }}"
|
||
|
# last_name: "{{ last_name }}"
|
||
|
# when:
|
||
|
# - oktalist['json'] is not defined
|
||
|
# - isActive|bool == True
|