Giter Site home page Giter Site logo

ansible-role-ezeelogin's Introduction

Ansible role Ezeelogin

This role installs Ezeelogin standalone or cluster setups.

Requirements

None.

Role Variables

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.

Usage

Example Playbook

---
- hosts: localhost
  become: true
  roles:
    - role: ansible-role-ezeelogin

Server addition/deletion

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

ACLs

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

Command guards

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

License

MIT

Author Information

This role was created in 2020 by jpiron.

ansible-role-ezeelogin's People

Contributors

jpiron avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.