From 50688115c98b8df37aa158338d23abeec0586d5f Mon Sep 17 00:00:00 2001 From: Mischa ter Smitten Date: Fri, 10 Jan 2025 16:13:14 +0100 Subject: [PATCH] Fix failing EULA --- molecule/default/converge.yml | 3 +++ tasks/install.yml | 10 ++-------- tests/test.yml | 3 +++ tests/vagrant.yml | 3 +++ tests/vars/main.yml | 4 ++++ vars/main.yml | 11 ++--------- 6 files changed, 17 insertions(+), 17 deletions(-) create mode 100644 tests/vars/main.yml 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..f02b0f8 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 }}"