diff --git a/molecule/default/converge.yml b/molecule/default/converge.yml index be762b2..8596f09 100644 --- a/molecule/default/converge.yml +++ b/molecule/default/converge.yml @@ -2,5 +2,8 @@ - name: Converge hosts: all become: true + pre_tasks: + - name: include vars + ansible.builtin.include_vars: "{{ playbook_dir }}/../../tests/vars/main.yml" roles: - ../../../ diff --git a/tasks/install.yml b/tasks/install.yml index 481725e..a6163fd 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -1,17 +1,10 @@ # tasks file --- -- name: install | configure debconf - ansible.builtin.debconf: - name: "{{ item.name }}" - question: "{{ item.question }}" - value: "{{ item.value }}" - vtype: "{{ item.vtype }}" - with_items: "{{ msodbcsql_debconf_selections }}" - - name: install | dependencies ansible.builtin.apt: name: "{{ msodbcsql_dependencies }}" state: "{{ apt_install_state | default('latest') }}" + environment: "{{ msodbcsql_apt_environment }}" tags: - msodbcsql-install-dependencies @@ -19,5 +12,6 @@ ansible.builtin.apt: name: "{{ msodbcsql_install }}" state: "{{ apt_install_state | default('latest') }}" + environment: "{{ msodbcsql_apt_environment }}" tags: - msodbcsql-install-additional diff --git a/tests/test.yml b/tests/test.yml index 6ca55c7..d62b457 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -4,5 +4,8 @@ hosts: localhost connection: local become: true + pre_tasks: + - name: include vars + ansible.builtin.include_vars: "{{ playbook_dir }}/vars/main.yml" roles: - ../../ diff --git a/tests/vagrant.yml b/tests/vagrant.yml index c51aabf..09d366d 100644 --- a/tests/vagrant.yml +++ b/tests/vagrant.yml @@ -4,5 +4,8 @@ hosts: all remote_user: vagrant become: true + pre_tasks: + - name: include vars + ansible.builtin.include_vars: "{{ playbook_dir }}/vars/main.yml" roles: - ../../ diff --git a/tests/vars/main.yml b/tests/vars/main.yml new file mode 100644 index 0000000..640118f --- /dev/null +++ b/tests/vars/main.yml @@ -0,0 +1,4 @@ +# vars file +--- +msodbcsql_install: + - "mssql-tools{{ msodbcsql_version }}" diff --git a/vars/main.yml b/vars/main.yml index efc550e..d1f298f 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -13,15 +13,8 @@ msodbcsql_dependencies_pre: - apt-transport-https - wget -msodbcsql_debconf_selections: - - name: "msodbcsql{{ msodbcsql_version }}" - question: msodbcsql/ACCEPT_EULA - value: true - vtype: boolean - - name: "mssql-tools{{ msodbcsql_version }}" - question: mssql-tools/ACCEPT_EULA - value: true - vtype: boolean +msodbcsql_apt_environment: + ACCEPT_EULA: Y msodbcsql_dependencies: - "msodbcsql{{ msodbcsql_version }}"