---

- name: Manage NodeJS environment
  collections: [ 'debops.debops', 'debops.roles01',
                 'debops.roles02', 'debops.roles03' ]
  hosts: [ 'debian10' ]
  become: True

  environment: '{{ inventory__environment | d({})
                   | combine(inventory__group_environment | d({}))
                   | combine(inventory__host_environment  | d({})) }}'

  vars:
    nodejs__node_upstream: True
    nodejs__node_upstream_release: node_18.x

  roles:

    - role: keyring
      tags: [ 'role::keyring', 'skip::keyring', 'role::nodejs' ]
      keyring__dependent_apt_keys:
        - '{{ nodejs__keyring__dependent_apt_keys }}'

    - role: apt_preferences
      tags: [ 'role::apt_preferences', 'skip::apt_preferences' ]
      apt_preferences__dependent_list:
        - '{{ nodejs__apt_preferences__dependent_list }}'

    - role: nodejs
      tags: [ 'role::nodejs', 'skip::nodejs' ]