Use distro specific netcat package names

Update the memcached-flush upgrade playbook with the correct distro
specific name of the netcat package and fix a typo in the
'ansible_os_family' variable name.

Change-Id: I140bcf45ca4c7b338b2fec69188a80d4226fb2cb
(cherry picked from commit 3b910f106b)
This commit is contained in:
Jimmy McCrory 2017-06-19 09:51:43 -07:00 committed by Jesse Pretorius (odyssey4me)
parent 03a643695d
commit 8c26e45d9b
1 changed files with 6 additions and 3 deletions

View File

@ -21,11 +21,14 @@
memcached_conf_dest:
debian: "/etc/memcached.conf"
redhat: "/etc/sysconfig/memcached"
netcat_package:
debian: "netcat-openbsd"
redhat: "nmap-ncat"
tasks:
- name: Ensuring nc is installed
- name: Ensuring netcat is installed
package:
name: nc
name: "{{ netcat_package.get(ansible_os_family | lower) }}"
state: present
- name: Flush all of the cache in memcached
shell: |
echo 'flush_all' | nc $(awk '/^\-l/ {print $2}' {{ memcached_conf_dest.get(ansible_os_family | lower) }} | awk -F, '{ print $1 }') $(awk '/^\-p/ {print $2}' {{ memcached_conf_dest.get(ansible_family | lower) }} )
echo 'flush_all' | nc $(awk '/^\-l/ {print $2}' {{ memcached_conf_dest.get(ansible_os_family | lower) }} | awk -F, '{ print $1 }') $(awk '/^\-p/ {print $2}' {{ memcached_conf_dest.get(ansible_os_family | lower) }} )