This role installs Ezeelogin standalone or cluster setups.
None.
Variables, along with their default values, are listed in defaults/main.yml
.
To setup an Ezeelogin cluster, make sure to define an ezeelogin_cluster_id
.
This is an arbitrary value to retrieve hosts of the same cluster.
---
- hosts: localhost
become: true
roles:
- role: ansible-role-ezeelogin
Server addition/deletion through the API requires the API to be manually enabled first.
As a result, no server addition will be performed while running this role.
It should be done through a different Ansible task/playbook:
---
- name: Configure Ezeelogin target servers
hosts:
- ezeelogin_targets
diff: True
tasks:
- name: Retrieve Ezeelogin standalone or master node
set_fact:
ezeelogin_master: "{{ groups['ezeelogin_servers']
| difference(groups['ezeelogin_slaves'])
| map('extract', hostvars)
| selectattr('ezeelogin_cluster_id', 'defined')
| selectattr('ezeelogin_cluster_id', 'equalto', ezeelogin_cluster_id)
| map(attribute='inventory_hostname')
| first }}"
- name: Add Ezeelogin target server on master node
import_role:
name: ansible-role-ezeelogin
tasks_from: add_server.yml
delegate_to: "{{ ezeelogin_master }}"
vars:
ezeelogin_api_url: https://ezeelogin.local
ezeelogin_api_secret: XXX
server:
name: "{{ inventory_hostname }}"
ip_address: "{{ ansible_host }}"
ssh_user: "{{ ansible_user | default('root') }}"
ssh_port: "{{ ansible_port | default(22) }}"
group: "{{ ezeelogin_server_group_name | default('unassigned') }}"
enable_ssh: 'Y'
- name: Update Ezeelogin target server on master node
import_role:
name: ansible-role-ezeelogin
tasks_from: add_server.yml
delegate_to: "{{ ezeelogin_master }}"
vars:
ezeelogin_api_url: https://ezeelogin.local
ezeelogin_api_secret: XXX
server:
name: "{{ inventory_hostname }}"
ip_address: 1.1.1.1
state: updated
- name: Remove Ezeelogin target server on master node
import_role:
name: ansible-role-ezeelogin
tasks_from: add_server.yml
delegate_to: "{{ ezeelogin_master }}"
vars:
ezeelogin_api_url: https://ezeelogin.local
ezeelogin_api_secret: XXX
server:
name: foobar
state: absent
Variables that can be set while adding a server are listed in vars/main.yml::ezelogin_server_addition_parameters
This role provides a taskset acls.yml
to manage Ezeelogin ACLs.
Currently, only user->server and user->server group ACLs are managed.
As the user and server group creations aren't managed by this roles yet, the ACLs aren't created when running this role.
It should be done through a different Ansible task/playbook:
---
- name: Configure Ezeelogin ACLs
hosts:
- ezeelogin_servers
diff: True
tasks:
- name: Configure Ezeelogin ACLs
import_role:
name: ansible-role-ezeelogin
tasks_from: acls.yml
vars:
ezlogin_database_table_prefix: foobarbaz
ezeelogin_acls:
- username: username_01
ezeelogin_server_groups:
- name: prod
state: absent
- name: test
state: present
ezeelogin_servers:
- name: server_01
state: absent
- name: server_01
state: present
This role provides a taskset command_guards.yml
to manage Ezeelogin command guards. \
As the command and command groups creations aren't managed by this roles yet, the command guards aren't created when running this role.
It should be done through a different Ansible task/playbook:
---
- name: Configure Ezeelogin command guards
hosts:
- ezeelogin_servers
diff: True
tasks:
- name: Configure Ezeelogin command guards
import_role:
name: ansible-role-ezeelogin
tasks_from: command_guards.yml
vars:
ezlogin_database_table_prefix: foobarbaz
ezeelogin_command_guards:
- username: username_01
command_group_name: command_group_name_01
command_guard_type: Allow
- username: username_02
command_group_name: command_group_name_02
command_guard_type: Disallow
MIT
This role was created in 2020 by jpiron.