ScaleComputing / HyperCoreAnsibleCollection

Official Ansible collection for Scale Computing SC//HyperCore (HC3) v1 API
GNU General Public License v3.0
12 stars 8 forks source link

cluster_config role #139

Closed justinc1 closed 1 year ago

justinc1 commented 1 year ago

The PR adds a role for initial cluster configuration. Role primary usage is to configure an empty cluster.

A dict to fully configure cluster looks like:

    scale_computing_hypercore_cluster_config:
      name: cluster-a
      registration:
        company_name: New company a
        contact: John Smith a
        phone: 056789000
        email: john_smith_a@gmail.com
      dns:
        server_ips:
          - 1.1.1.1
          - 1.0.0.1
        search_domains:
          - subdomain_1.example.com
          - subdomain_2.example.com
      oidc:
        client_id: 12345a
        shared_secret: secret_stuff_a
        config_url: https://login.microsoftonline.com/76d4c62a-a9ca-4dc2-9187-e2cc4d9abe7f/v2.0/.well-known/openid-configuration
        scopes: openid+profile
      time_server: 2.pool.ntp.org
      time_zone: Europe/Ljubljana
      smtp:
        server: mail_a.example.com
        port: 25
        from_address: "ci-test-a@example.com"
      email_alerts:
        - user_a1@test.com
      syslog_servers:
        - host: 10.10.10.10
          port: 42
          protocol: tcp

As secondary usage, a partial cluster configuration is possible. User just needs to invoke role with stripped version of scale_computing_hypercore_cluster_config variable.

Some modules are able to unconfigure a system, and some cannot. For example, syslog_server module is able to remove configured syslog server, but OIDC cannot be removed once setup. I'm not sure if this role should allow unconfiguration of a system. So I ask for advice here, what is best.

For first draft, role can remove syslog_servers, email alerts, dns server and search_domains. If user needs to remove other configuration, a corresponding module can be used.

On TODO list: