Standardize dictionary entries for config in role variables #4

Open
opened 2025-12-16 16:54:17 +00:00 by admin · 0 comments
Owner

The dictionary entries (i.e., key-value pairs) for the config key in ${SKATO_ANSIBLE_ROOT}/roles/*/{vars,defaults}/main/software.yml needs to be more standardized in their keys, in the way that they are in dictionary entries for the users or groups key in ${SKATO_ANSIBLE_ROOT}/{host_vars,group_vars}/${inventory_host_or_group_name}.yml. Of course, inevitably there will be some unique entries given that configurations for software depend on software purpose or function to begin with, but there should be a reasonable amount of overlap among keys of the entries of at least some of the configuration objects.

An example would be that, instead of config.proftpd and config.nextcloud having disparate key/field names for their user entries, as seen below:

config:
  proftpd:
    name: "{{ hostvars[inventory_hostname].fqdn.split('.')[0] }}"
    auth_filepaths:
      users_path: "/etc/proftpd/ftpd.passwd"
      groups_path: "/etc/proftpd/ftpd.group"
    msg:
      welcome: "Hi hi~!"  
    vusers: # @NOTE notice this field/key name differs from "config.nextcloud"'s--consider whether that is necessary
      webmaster:
        username: "webmaster"
        id_of: "{{ ['caddy', 'www-data'][0] }}"
        gid_of: "{{ ['caddy', 'www-data'][0] }}"
        password: "h@ckmyFtp"
        services: ["http","https"]
      smuggler:
        username: "smuggler"
        id_of: "{{ hostvars[inventory_hostname]['users']['ftp']['username'] }}"
        gid_of: "{{ hostvars[inventory_hostname]['users']['ftp']['group'] | default(hostvars[inventory_hostname]['users']['ftp']['username']) }}"
        password: "plzH@c|<m3@ga1n"
        services: []
    tls_paths:
      cert: "/usr/local/share/ca-certificates/{{ hostvars[inventory_hostname]['fqdn'] }}.crt"
      privkey: "/usr/local/share/ca-certificates/{{ hostvars[inventory_hostname]['fqdn'] }}.key"
  nextcloud:
    users: # @NOTE notice this field/key name differs from "config.proftpd"'s--consider whether that is necessary
      admin:
        username: "admin"
        password: "password123"
    phone_region: "US"

They could have a shared key/field name for this purpose:

config:
  proftpd:
    name: "{{ hostvars[inventory_hostname].fqdn.split('.')[0] }}"
    auth_filepaths:
      users_path: "/etc/proftpd/ftpd.passwd"
      groups_path: "/etc/proftpd/ftpd.group"
    msg:
      welcome: "Hi hi~!"  
    users: # @NOTE now this key/field is the same as "config.nextcloud"'s
      webmaster:
        username: "webmaster"
        id_of: "{{ ['caddy', 'www-data'][0] }}"
        gid_of: "{{ ['caddy', 'www-data'][0] }}"
        password: "h@ckmyFtp"
        services: ["http","https"]
      smuggler:
        username: "smuggler"
        id_of: "{{ hostvars[inventory_hostname]['users']['ftp']['username'] }}"
        gid_of: "{{ hostvars[inventory_hostname]['users']['ftp']['group'] | default(hostvars[inventory_hostname]['users']['ftp']['username']) }}"
        password: "plzH@c|<m3@ga1n"
        services: []
    tls_paths:
      cert: "/usr/local/share/ca-certificates/{{ hostvars[inventory_hostname]['fqdn'] }}.crt"
      privkey: "/usr/local/share/ca-certificates/{{ hostvars[inventory_hostname]['fqdn'] }}.key"
  nextcloud: # @NOTE now this key/field is the same as "config.proftpd"'s
    users: # @NOTE notice this field/key name differs from "config.proftpd"'s--consider whether that is necessary
      admin:
        username: "admin"
        password: "password123"
    phone_region: "US"
The dictionary entries (i.e., key-value pairs) for the `config` key in `${SKATO_ANSIBLE_ROOT}/roles/*/{vars,defaults}/main/software.yml` needs to be more standardized in their keys, in the way that they are in dictionary entries for the `users` or `groups` key in `${SKATO_ANSIBLE_ROOT}/{host_vars,group_vars}/${inventory_host_or_group_name}.yml`. Of course, inevitably there will be some unique entries given that configurations for software depend on software purpose or function to begin with, but there should be a reasonable amount of overlap among keys of the entries of at least some of the configuration objects. An example would be that, instead of `config.proftpd` and `config.nextcloud` having disparate key/field names for their user entries, as seen below: ```yaml config: proftpd: name: "{{ hostvars[inventory_hostname].fqdn.split('.')[0] }}" auth_filepaths: users_path: "/etc/proftpd/ftpd.passwd" groups_path: "/etc/proftpd/ftpd.group" msg: welcome: "Hi hi~!" vusers: # @NOTE notice this field/key name differs from "config.nextcloud"'s--consider whether that is necessary webmaster: username: "webmaster" id_of: "{{ ['caddy', 'www-data'][0] }}" gid_of: "{{ ['caddy', 'www-data'][0] }}" password: "h@ckmyFtp" services: ["http","https"] smuggler: username: "smuggler" id_of: "{{ hostvars[inventory_hostname]['users']['ftp']['username'] }}" gid_of: "{{ hostvars[inventory_hostname]['users']['ftp']['group'] | default(hostvars[inventory_hostname]['users']['ftp']['username']) }}" password: "plzH@c|<m3@ga1n" services: [] tls_paths: cert: "/usr/local/share/ca-certificates/{{ hostvars[inventory_hostname]['fqdn'] }}.crt" privkey: "/usr/local/share/ca-certificates/{{ hostvars[inventory_hostname]['fqdn'] }}.key" nextcloud: users: # @NOTE notice this field/key name differs from "config.proftpd"'s--consider whether that is necessary admin: username: "admin" password: "password123" phone_region: "US" ``` They could have a shared key/field name for this purpose: ```yaml config: proftpd: name: "{{ hostvars[inventory_hostname].fqdn.split('.')[0] }}" auth_filepaths: users_path: "/etc/proftpd/ftpd.passwd" groups_path: "/etc/proftpd/ftpd.group" msg: welcome: "Hi hi~!" users: # @NOTE now this key/field is the same as "config.nextcloud"'s webmaster: username: "webmaster" id_of: "{{ ['caddy', 'www-data'][0] }}" gid_of: "{{ ['caddy', 'www-data'][0] }}" password: "h@ckmyFtp" services: ["http","https"] smuggler: username: "smuggler" id_of: "{{ hostvars[inventory_hostname]['users']['ftp']['username'] }}" gid_of: "{{ hostvars[inventory_hostname]['users']['ftp']['group'] | default(hostvars[inventory_hostname]['users']['ftp']['username']) }}" password: "plzH@c|<m3@ga1n" services: [] tls_paths: cert: "/usr/local/share/ca-certificates/{{ hostvars[inventory_hostname]['fqdn'] }}.crt" privkey: "/usr/local/share/ca-certificates/{{ hostvars[inventory_hostname]['fqdn'] }}.key" nextcloud: # @NOTE now this key/field is the same as "config.proftpd"'s users: # @NOTE notice this field/key name differs from "config.proftpd"'s--consider whether that is necessary admin: username: "admin" password: "password123" phone_region: "US" ```
admin added the qol/featureqol/refactor labels 2025-12-16 16:54:17 +00:00
admin added this to the fully standardized entries milestone 2025-12-16 16:54:25 +00:00
admin added this to the skato-ansible feature release project 2025-12-16 16:55:10 +00:00
admin self-assigned this 2025-12-16 16:55:15 +00:00
admin moved this to To Do in skato-ansible feature release on 2025-12-16 17:05:56 +00:00
admin added the fix/usability_bug label 2025-12-16 17:43:48 +00:00
admin moved this to In Progress in skato-ansible feature release on 2025-12-21 22:04:18 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: admin/skato-ansible#4