From be9c7fce9ca53fd148869f26330e020dbe78d0a4 Mon Sep 17 00:00:00 2001 From: Greg Szabo Date: Fri, 15 Sep 2017 14:54:23 -0400 Subject: [PATCH] Made the tomlconfig playbook even faster --- ansible/roles/tomlconfig/tasks/main.yml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/ansible/roles/tomlconfig/tasks/main.yml b/ansible/roles/tomlconfig/tasks/main.yml index acc24dfc..518e0f3e 100644 --- a/ansible/roles/tomlconfig/tasks/main.yml +++ b/ansible/roles/tomlconfig/tasks/main.yml @@ -2,17 +2,9 @@ - name: Update config.toml with json when: jsonconfig is defined - tomlconfig: "dest=/etc/{{service}}/tendermint/config.toml json='{{jsonconfig}}'" + tomlconfig: "dest=/etc/{{service}}/tendermint/config.toml json='{{jsonconfig}}' state={{(remove | default(false) | bool) | ternary('absent','present')}}" - name: Update config.toml with toml when: tomlconfig is defined - tomlconfig: "dest=/etc/{{service}}/tendermint/config.toml toml='{{tomlconfig}}'" - -- name: Update config.toml with json - removal - when: jsonconfigremove is defined - tomlconfig: "dest=/etc/{{service}}/tendermint/config.toml json='{{jsonconfigremove}}'" - -- name: Update config.toml with toml - removal - when: tomlconfigremove is defined - tomlconfig: "dest=/etc/{{service}}/tendermint/config.toml toml='{{tomlconfigremove}}'" + tomlconfig: "dest=/etc/{{service}}/tendermint/config.toml toml='{{tomlconfig}}' state={{(remove | default(false) | bool) | ternary('absent','present')}}"