From c8258171ca4253b2dde753e83631c3d12176da43 Mon Sep 17 00:00:00 2001
From: Anton Nerozya <nerozya.anton@gmail.com>
Date: Thu, 29 Jun 2017 19:46:27 +0200
Subject: [PATCH] Better naming for recurrent tasks

---
 roles/vault/tasks/bootstrap/ca_trust.yml | 2 +-
 roles/vault/tasks/shared/issue_cert.yml  | 6 +++---
 roles/vault/tasks/shared/sync.yml        | 4 ++--
 roles/vault/tasks/shared/sync_file.yml   | 4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/roles/vault/tasks/bootstrap/ca_trust.yml b/roles/vault/tasks/bootstrap/ca_trust.yml
index 63ab256d5..ae67f7405 100644
--- a/roles/vault/tasks/bootstrap/ca_trust.yml
+++ b/roles/vault/tasks/bootstrap/ca_trust.yml
@@ -1,6 +1,6 @@
 ---
 
-- name: bootstrap/ca_trust | pull CA from cert from groups.vault|first
+- name: "bootstrap/ca_trust | pull CA from cert from {{groups.vault|first}}"
   command: "cat {{ vault_cert_dir }}/ca.pem"
   register: vault_cert_file_cat
   delegate_to: "{{ groups['vault']|first }}"
diff --git a/roles/vault/tasks/shared/issue_cert.yml b/roles/vault/tasks/shared/issue_cert.yml
index 0733e86a0..cb3685bf5 100644
--- a/roles/vault/tasks/shared/issue_cert.yml
+++ b/roles/vault/tasks/shared/issue_cert.yml
@@ -26,7 +26,7 @@
     mode: "{{ issue_cert_dir_mode | d('0755') }}"
     owner: "{{ issue_cert_file_owner | d('root') }}"
 
-- name: issue_cert | Generate the cert
+- name: "issue_cert | Generate the cert for {{ issue_cert_role }}"
   uri:
     url: "{{ issue_cert_url }}/v1/{{ issue_cert_mount|d('pki') }}/issue/{{ issue_cert_role }}"
     headers: "{{ issue_cert_headers }}"
@@ -40,7 +40,7 @@
   register: issue_cert_result
   when: inventory_hostname == issue_cert_hosts|first
 
-- name: issue_cert | Copy the cert to all hosts
+- name: "issue_cert | Copy {{ issue_cert_path }} cert to all hosts"
   copy:
     content: "{{ hostvars[issue_cert_hosts|first]['issue_cert_result']['json']['data']['certificate'] }}"
     dest: "{{ issue_cert_path }}"
@@ -48,7 +48,7 @@
     mode: "{{ issue_cert_file_mode | d('0644') }}"
     owner: "{{ issue_cert_file_owner | d('root') }}"
 
-- name: issue_cert | Copy the key to all hosts
+- name: "issue_cert | Copy key for {{ issue_cert_path }} to all hosts"
   copy:
     content: "{{ hostvars[issue_cert_hosts|first]['issue_cert_result']['json']['data']['private_key'] }}"
     dest: "{{ issue_cert_path.rsplit('.', 1)|first }}-key.{{ issue_cert_path.rsplit('.', 1)|last }}"
diff --git a/roles/vault/tasks/shared/sync.yml b/roles/vault/tasks/shared/sync.yml
index bbfedbc4c..102532f0c 100644
--- a/roles/vault/tasks/shared/sync.yml
+++ b/roles/vault/tasks/shared/sync.yml
@@ -28,7 +28,7 @@
     state: directory
   when: inventory_hostname not in sync_file_srcs
 
-- name: "sync_file | Copy the file to hosts that don't have it"
+- name: "sync_file | Copy {{ sync_file_path }} to hosts that don't have it"
   copy:
     content: "{{ sync_file_contents }}"
     dest: "{{ sync_file_path }}"
@@ -37,7 +37,7 @@
     owner: "{{ sync_file_owner|d('root') }}"
   when: inventory_hostname not in sync_file_srcs
 
-- name: "sync_file | Copy the key file to hosts that don't have it"
+- name: "sync_file | Copy {{ sync_file_key_path }} to hosts that don't have it"
   copy:
     content: "{{ sync_file_key_contents }}"
     dest: "{{ sync_file_key_path }}"
diff --git a/roles/vault/tasks/shared/sync_file.yml b/roles/vault/tasks/shared/sync_file.yml
index ef53e9d90..be5284154 100644
--- a/roles/vault/tasks/shared/sync_file.yml
+++ b/roles/vault/tasks/shared/sync_file.yml
@@ -19,12 +19,12 @@
   when: >-
         sync_file_is_cert|d() and (sync_file_key_path is not defined or sync_file_key_path == '')
 
-- name: "sync_file | Check if file exists"
+- name: "sync_file | Check if {{sync_file_path}} file exists"
   stat:
     path: "{{ sync_file_path }}"
   register: sync_file_stat
 
-- name: "sync_file | Check if key file exists"
+- name: "sync_file | Check if {{ sync_file_key_path }} key file exists"
   stat:
     path: "{{ sync_file_key_path }}"
   register: sync_file_key_stat
-- 
GitLab