From 8351b577858fc4bd6ea69b402783c941e9e3e003 Mon Sep 17 00:00:00 2001 From: Dan Burzynski Date: Tue, 22 May 2018 16:42:12 +0100 Subject: [PATCH] Adding ability to disable install of java file (for different environments) --- README.md | 8 +++++++- defaults/main.yml | 4 +++- tasks/main.yml | 3 ++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f43d216..9a12800 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,12 @@ Role Variables Things that you might want to change: +```yaml +wiremock_install: true +``` + +By default, this role will install wiremock, but setting this to false will skip installation. (So that you can skip it on production environments for example) + ```yaml wiremock_daemon: true ``` @@ -84,7 +90,7 @@ Example Playbook - hosts: servers roles: - - { role: c0ntax.wiremock } + - { role: c0ntax.wiremock, wiremock_install: true, wiremock_daemon: true } License ------- diff --git a/defaults/main.yml b/defaults/main.yml index 1adf95b..9cb84b8 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,11 +1,13 @@ --- # defaults file for wiremock +wiremock_install: true +wiremock_daemon: true + wiremock_version: 2.17.0 wiremock_src: "http://repo1.maven.org/maven2/com/github/tomakehurst/wiremock-standalone/{{ wiremock_version }}/wiremock-standalone-{{ wiremock_version }}.jar" wiremock_original: "/usr/share/java/wiremock-standalone-{{ wiremock_version }}.jar" wiremock_dest: /usr/share/java/wiremock-standalone.jar -wiremock_daemon: true wiremock_service_state: started wiremock_root_dir: /var/wiremock wiremock_user: nobody diff --git a/tasks/main.yml b/tasks/main.yml index e4c79f1..df073af 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -2,5 +2,6 @@ # tasks file for wiremock - include: install.yml + when: wiremock_install - include: configure.yml - when: wiremock_daemon + when: wiremock_install and wiremock_daemon