diff --git a/.travis.yml b/.travis.yml index b1bbe6e..31ee081 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ env: # run against latest version - ANSIBLE_VERSION=latest # run against minimal required version - - ANSIBLE_VERSION=2.0.* + - ANSIBLE_VERSION=2.5.* # Use the new container infrastructure sudo: false diff --git a/README.md b/README.md index 4e730eb..f83f3a7 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,8 @@ If you want to use a Git configuration repository, you need to at least set the conga_maven_opts: "-B -U -Dconga.environments={{ conga_environment }}" # Path of a custom settings file to use when running Maven conga_maven_settings: ~/.m2/settings.xml + # Path to the Vault password file, defaults to Ansible configuration + conga_maven_vault_password_file: "{{ lookup('config', 'DEFAULT_VAULT_PASSWORD_FILE') }}" These variables let you customize the way Maven is executed, e.g. supplying a full path for the Maven executable or supplying a custom settings file. diff --git a/defaults/main.yml b/defaults/main.yml index a227aa5..49a211f 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -8,6 +8,8 @@ conga_maven_root: configuration # Maven command to execute conga_maven_cmd: mvn +# Path to the Vault password file, defaults to Ansible configuration +conga_maven_vault_password_file: "{{ lookup('config', 'DEFAULT_VAULT_PASSWORD_FILE') }}" # Maven options (run in batch mode, update snapshots and only compile a single environment) conga_maven_opts: "-B -U -Dconga.environments={{ conga_environment }}" # Path of a custom settings file to use when running Maven diff --git a/meta/main.yml b/meta/main.yml index 1b9078e..4b2a1c9 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -5,7 +5,7 @@ galaxy_info: company: pro!vision issue_tracker_url: https://wcm-io.atlassian.net license: Apache - min_ansible_version: 2.0 + min_ansible_version: 2.5 platforms: - name: Ubuntu diff --git a/tasks/main.yml b/tasks/main.yml index b82f7a1..bba8319 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -29,7 +29,12 @@ - name: Add custom Maven settings. set_fact: _mvn_cmdline: "{{ _mvn_cmdline }} --settings={{ conga_maven_settings }}" - when: conga_maven_settings is defined + when: conga_maven_settings is defined and conga_maven_settings + +- name: Add Maven Vault password file. + set_fact: + _mvn_cmdline: "{{ _mvn_cmdline }} -Dansible.vault.password.file={{ conga_maven_vault_password_file }}" + when: conga_maven_vault_password_file is defined and conga_maven_vault_password_file - name: Compile CONGA configuration with Maven. shell: "{{ _mvn_cmdline }}"