diff --git a/.github/workflows/netbox.yml b/.github/workflows/netbox.yml index c673241..f54e520 100644 --- a/.github/workflows/netbox.yml +++ b/.github/workflows/netbox.yml @@ -21,6 +21,7 @@ jobs: - ubuntu2004 netbox: - v3.0.9 + - v3.0.10 services: postgres: diff --git a/molecule/v3.0.10/molecule.yml b/molecule/v3.0.10/molecule.yml index ef5b9c9..400f91b 100644 --- a/molecule/v3.0.10/molecule.yml +++ b/molecule/v3.0.10/molecule.yml @@ -1,6 +1,8 @@ --- dependency: name: galaxy + options: + role-file: molecule/default/requirements.yml driver: name: docker @@ -17,3 +19,7 @@ platforms: provisioner: name: ansible + playbooks: + prepare: ../default/prepare.yml + converge: converge.yml + verify: ../default/verify.yml diff --git a/molecule/v3.0.10/prepare.yml b/molecule/v3.0.10/prepare.yml deleted file mode 100644 index d22307a..0000000 --- a/molecule/v3.0.10/prepare.yml +++ /dev/null @@ -1,55 +0,0 @@ ---- -- name: Prepare - hosts: all - become: yes - - vars: - netbox_db_username: netbox - netbox_db_password: netbox - netbox_db_name: netbox - - pre_tasks: - - name: Update yum package cache - ansible.builtin.yum: - update_cache: yes - when: ansible_os_family == 'RedHat' - - - name: Update apt package cache - ansible.builtin.apt: - update_cache: yes - when: ansible_os_family == 'Debian' - - tasks: - # RHEL8+ container images only have C.UTF-8 installed - - name: Set database locale when using CentOS8/RHEL8+ - set_fact: - db_locale: C.UTF-8 - when: - - ansible_os_family == 'RedHat' - - ansible_distribution_major_version == '8' - - lookup('env', 'CI') != 'true' - - - name: Install crontabs - ansible.builtin.yum: - name: crontabs - when: ansible_os_family == 'RedHat' - - - name: Install PostgreSQL - include_role: - name: geerlingguy.postgresql - vars: - postgresql_users: - - name: "{{ netbox_db_username }}" - password: "{{ netbox_db_password }}" - db: "{{ netbox_db_name }}" - postgresql_databases: - - name: "{{ netbox_db_name }}" - owner: "{{ netbox_db_username }}" - lc_collate: "{{ db_locale | default('en_US.UTF-8') }}" - lc_ctype: "{{ db_locale | default('en_US.UTF-8') }}" - when: lookup('env', 'CI') != 'true' - - - name: Install Redis - include_role: - name: geerlingguy.redis - when: lookup('env', 'CI') != 'true' diff --git a/molecule/v3.0.10/requirements.yml b/molecule/v3.0.10/requirements.yml deleted file mode 100644 index d198b9f..0000000 --- a/molecule/v3.0.10/requirements.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -# Ansible requirements - -roles: - - name: geerlingguy.postgresql - scm: git - src: 'git+https://github.com/geerlingguy/ansible-role-postgresql' - version: 3.1.0 - - - name: geerlingguy.redis diff --git a/molecule/v3.0.10/verify.yml b/molecule/v3.0.10/verify.yml deleted file mode 100644 index 3b6584c..0000000 --- a/molecule/v3.0.10/verify.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -- name: Verify - hosts: all - - tasks: - - name: collect facts about system services - ansible.builtin.service_facts: - register: services_state - - - name: verify Netbox services are running - assert: - that: item.state == 'running' - with_items: - - "{{ services_state.ansible_facts.services['netbox.service'] }}" - - "{{ services_state.ansible_facts.services['netbox-rq.service'] }}" diff --git a/molecule/v3.0.9/molecule.yml b/molecule/v3.0.9/molecule.yml index ef5b9c9..400f91b 100644 --- a/molecule/v3.0.9/molecule.yml +++ b/molecule/v3.0.9/molecule.yml @@ -1,6 +1,8 @@ --- dependency: name: galaxy + options: + role-file: molecule/default/requirements.yml driver: name: docker @@ -17,3 +19,7 @@ platforms: provisioner: name: ansible + playbooks: + prepare: ../default/prepare.yml + converge: converge.yml + verify: ../default/verify.yml diff --git a/molecule/v3.0.9/prepare.yml b/molecule/v3.0.9/prepare.yml deleted file mode 100644 index d22307a..0000000 --- a/molecule/v3.0.9/prepare.yml +++ /dev/null @@ -1,55 +0,0 @@ ---- -- name: Prepare - hosts: all - become: yes - - vars: - netbox_db_username: netbox - netbox_db_password: netbox - netbox_db_name: netbox - - pre_tasks: - - name: Update yum package cache - ansible.builtin.yum: - update_cache: yes - when: ansible_os_family == 'RedHat' - - - name: Update apt package cache - ansible.builtin.apt: - update_cache: yes - when: ansible_os_family == 'Debian' - - tasks: - # RHEL8+ container images only have C.UTF-8 installed - - name: Set database locale when using CentOS8/RHEL8+ - set_fact: - db_locale: C.UTF-8 - when: - - ansible_os_family == 'RedHat' - - ansible_distribution_major_version == '8' - - lookup('env', 'CI') != 'true' - - - name: Install crontabs - ansible.builtin.yum: - name: crontabs - when: ansible_os_family == 'RedHat' - - - name: Install PostgreSQL - include_role: - name: geerlingguy.postgresql - vars: - postgresql_users: - - name: "{{ netbox_db_username }}" - password: "{{ netbox_db_password }}" - db: "{{ netbox_db_name }}" - postgresql_databases: - - name: "{{ netbox_db_name }}" - owner: "{{ netbox_db_username }}" - lc_collate: "{{ db_locale | default('en_US.UTF-8') }}" - lc_ctype: "{{ db_locale | default('en_US.UTF-8') }}" - when: lookup('env', 'CI') != 'true' - - - name: Install Redis - include_role: - name: geerlingguy.redis - when: lookup('env', 'CI') != 'true' diff --git a/molecule/v3.0.9/requirements.yml b/molecule/v3.0.9/requirements.yml deleted file mode 100644 index d198b9f..0000000 --- a/molecule/v3.0.9/requirements.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -# Ansible requirements - -roles: - - name: geerlingguy.postgresql - scm: git - src: 'git+https://github.com/geerlingguy/ansible-role-postgresql' - version: 3.1.0 - - - name: geerlingguy.redis diff --git a/molecule/v3.0.9/verify.yml b/molecule/v3.0.9/verify.yml deleted file mode 100644 index 3b6584c..0000000 --- a/molecule/v3.0.9/verify.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -- name: Verify - hosts: all - - tasks: - - name: collect facts about system services - ansible.builtin.service_facts: - register: services_state - - - name: verify Netbox services are running - assert: - that: item.state == 'running' - with_items: - - "{{ services_state.ansible_facts.services['netbox.service'] }}" - - "{{ services_state.ansible_facts.services['netbox-rq.service'] }}"