From bb8c0eec42b72ceff80fb2dd8d5cced6f265dbfd Mon Sep 17 00:00:00 2001
From: Maarten de Waard <maarten@greenhost.nl>
Date: Mon, 25 Oct 2021 15:33:30 +0200
Subject: [PATCH] use command module instead of shell so passwords to not mess
 up the system

---
 values-local.yaml.example                         | 4 ++--
 values.yaml                                       | 4 ++--
 wp-cli-docker/roles/wordpress-init/tasks/smtp.yml | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/values-local.yaml.example b/values-local.yaml.example
index 0e3e7ea..b8669dd 100644
--- a/values-local.yaml.example
+++ b/values-local.yaml.example
@@ -121,7 +121,7 @@ smtp_settings:
   # Enable using these SMTP settings
   enabled: false
   # Username for SMTP authentication
-  smtp_user: admin@example.com 
+  smtp_user: admin@example.com
   # Password for STMP authentication
   smtp_pass: password
   # Hostname of the mailserver
@@ -129,7 +129,7 @@ smtp_settings:
   # SMTP from email address
   smtp_from: admin@example.com
   # SMTP from name
-  smtp_name: Admin
+  smtp_name: WordPress Admin
   # SMTP port number - likely to be 25, 465 or 587
   smtp_port: 587
   # Encryption system to use - ssl or tls
diff --git a/values.yaml b/values.yaml
index 0a42e6b..317dc07 100644
--- a/values.yaml
+++ b/values.yaml
@@ -192,11 +192,11 @@ service:
 # See values-local.yaml.example for an explanation of these variables
 smtp_settings:
   enabled: false
-  smtp_user: admin@example.com 
+  smtp_user: admin@example.com
   smtp_pass: password
   smtp_host: smtp.greenhost.nl
   smtp_from: admin@example.com
-  smtp_name: Admin
+  smtp_name: WordPress Admin
   smtp_port: 587
   smtp_secure: 'tls'
   smtp_auth: true
diff --git a/wp-cli-docker/roles/wordpress-init/tasks/smtp.yml b/wp-cli-docker/roles/wordpress-init/tasks/smtp.yml
index 5f26699..ac983fc 100644
--- a/wp-cli-docker/roles/wordpress-init/tasks/smtp.yml
+++ b/wp-cli-docker/roles/wordpress-init/tasks/smtp.yml
@@ -1,8 +1,8 @@
 - name: Define SMTP variables
-  shell: wp {{ cli_args }} config set "{{ item.key }}" "{{ item.value }}" --add --type=constant
+  command: wp {{ cli_args }} config set "{{ item.key }}" "{{ item.value }}" --add --type=constant
   loop: "{{ WP_SMTP_SETTINGS | dict2items }}"
 
 - name: Define SMTP variables
-  shell: wp {{ cli_args }} config set "{{ item.key }}" "{{ item.value }}" --add --raw --type=constant
+  command: wp {{ cli_args }} config set "{{ item.key }}" "{{ item.value }}" --add --raw --type=constant
   loop: "{{ WP_SMTP_RAW_SETTINGS | dict2items }}"
 
-- 
GitLab