From 759e285184f594749a8d443db145298e910a2892 Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Fri, 3 Dec 2021 18:01:33 +0000 Subject: [PATCH] Use newlist's automate option It appears that simply setting stdin to an empty string is insufficient to make newlist calls from Ansible correctly look like they're coming from a non-interactive shell. As it turns out, newer versions of the command include a -a (--automate) option which does exactly what we want: sends list admin notifications on creation without prompting for manual confirmation. Drop the test-time addition of -q to quell listadmin notifications, as we now block outbound 25/tcp from nodes in our deploy tests. This has repeatedly exposed a testing gap, where the behavior in production was broken because of newlist processes hanging awaiting user input even though we never experienced it in testing due to the -q addition there. Change-Id: I550ea802929235d55750c4d99c7d9beec28260f0 --- playbooks/roles/mailman-list/tasks/main.yaml | 6 ++---- .../templates/host_vars/lists.katacontainers.io.yaml.j2 | 1 - .../zuul/templates/host_vars/lists.openstack.org.yaml.j2 | 1 - 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/playbooks/roles/mailman-list/tasks/main.yaml b/playbooks/roles/mailman-list/tasks/main.yaml index 11beb0dd00..55a8fe984e 100644 --- a/playbooks/roles/mailman-list/tasks/main.yaml +++ b/playbooks/roles/mailman-list/tasks/main.yaml @@ -11,8 +11,7 @@ register: listlists - name: Create the site list if it doesn't exist command: - cmd: "newlist {% if mailman_test_mode is defined and mailman_test_mode %} -q {% endif %} {{ mm_list_name }} {{ mm_list_admin }} {{ mm_list_password }}" - stdin: '' + cmd: "newlist -a {{ mm_list_name }} {{ mm_list_admin }} {{ mm_list_password }}" environment: HOST: "{{ mm_site_listdomain }}" when: @@ -26,8 +25,7 @@ register: listlists - name: Create the list if it doesn't exist command: - cmd: "newlist {% if mailman_test_mode is defined and mailman_test_mode %} -q {% endif %} {{ mm_list_name }} {{ mm_list_admin }} {{ mm_list_password }}" - stdin: '' + cmd: "newlist -a {{ mm_list_name }} {{ mm_list_admin }} {{ mm_list_password }}" when: - ( listlists.stdout_lines | intersect([ mm_list_name ]) | length | int ) == 0 when: mm_site_name == "_default" diff --git a/playbooks/zuul/templates/host_vars/lists.katacontainers.io.yaml.j2 b/playbooks/zuul/templates/host_vars/lists.katacontainers.io.yaml.j2 index 04184d0a99..277ccbaebd 100644 --- a/playbooks/zuul/templates/host_vars/lists.katacontainers.io.yaml.j2 +++ b/playbooks/zuul/templates/host_vars/lists.katacontainers.io.yaml.j2 @@ -1,2 +1 @@ mailman_list_password: notarealpassword -mailman_test_mode: true diff --git a/playbooks/zuul/templates/host_vars/lists.openstack.org.yaml.j2 b/playbooks/zuul/templates/host_vars/lists.openstack.org.yaml.j2 index 04184d0a99..277ccbaebd 100644 --- a/playbooks/zuul/templates/host_vars/lists.openstack.org.yaml.j2 +++ b/playbooks/zuul/templates/host_vars/lists.openstack.org.yaml.j2 @@ -1,2 +1 @@ mailman_list_password: notarealpassword -mailman_test_mode: true