summaryrefslogtreecommitdiff
path: root/test/integration/targets/sensu_client/tasks/main.yml
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/targets/sensu_client/tasks/main.yml')
-rw-r--r--test/integration/targets/sensu_client/tasks/main.yml22
1 files changed, 10 insertions, 12 deletions
diff --git a/test/integration/targets/sensu_client/tasks/main.yml b/test/integration/targets/sensu_client/tasks/main.yml
index c15685ad81..387a7c1e22 100644
--- a/test/integration/targets/sensu_client/tasks/main.yml
+++ b/test/integration/targets/sensu_client/tasks/main.yml
@@ -22,24 +22,23 @@
- default
register: client
-- name: Retrieve configuration file stat
- stat:
- path: "{{ client_file }}"
- register: client_stat
+- name: Retrieve configuration file
+ slurp:
+ src: "{{ client_file }}"
+ register: client_config
- name: Assert that client data was set successfully and properly
assert:
that:
- "client is successful"
- "client is changed"
- - "client_stat.stat.exists == true"
- "client['config']['name'] == 'client'"
- "'default' in client['config']['subscriptions']"
- "client['file'] == client_file"
- name: Assert that the client configuration file is actually configured properly
vars:
- config: "{{ lookup('file', client_file) | from_json }}"
+ config: "{{ client_config.content | b64decode | from_json }}"
assert:
that:
- "config['client']['keepalives'] == true"
@@ -129,10 +128,10 @@
occurrences: "3"
register: client_twice
-- name: Retrieve configuration file stat
- stat:
- path: "{{ client_file }}"
- register: client_stat
+- name: Retrieve configuration file
+ slurp:
+ src: "{{ client_file }}"
+ register: client_config
- name: Assert that client data was set successfully and properly
assert:
@@ -141,7 +140,6 @@
- "client is changed"
- "client_twice is successful"
- "client_twice is not changed"
- - "client_stat.stat.exists == true"
- "client['config']['name'] == 'custom'"
- "client['config']['address'] == 'host.fqdn'"
- "'default' in client['config']['subscriptions']"
@@ -155,7 +153,7 @@
- name: Assert that the client configuration file is actually configured properly
vars:
- config: "{{ lookup('file', client_file) | from_json }}"
+ config: "{{ client_config.content | b64decode | from_json }}"
assert:
that:
- "config['client']['name'] == 'custom'"