Replace shell with command or disable warnings

This commit is contained in:
Jérémy Lecour 2017-05-21 19:33:16 +02:00
parent 1b24815491
commit 8772983746
2 changed files with 14 additions and 6 deletions

View file

@ -62,22 +62,30 @@
- name: is Ruby {{ rbenv_ruby_version }} available for {{ username }} ?
shell: /bin/bash -lc "rbenv versions | grep {{ rbenv_ruby_version }}"
args:
warn: no
failed_when: False
changed_when: False
register: ruby_installed
- name: Ruby {{ rbenv_ruby_version }} is available for {{ username }} (be patient... could be long)
shell: /bin/bash -lc "TMPDIR=~/tmp rbenv install {{ rbenv_ruby_version }}"
args:
warn: no
when: ruby_installed.rc != 0
- name: is Ruby {{ rbenv_ruby_version }} selected for {{ username }} ?
shell: /bin/bash -lc "rbenv version | cut -d ' ' -f 1 | grep -Fx '{{ rbenv_ruby_version }}'"
args:
warn: no
register: ruby_selected
changed_when: False
failed_when: False
- name: select Ruby {{ rbenv_ruby_version }} for {{ username }}
shell: /bin/bash -lc "rbenv global {{ rbenv_ruby_version }} && rbenv rehash"
args:
warn: no
when: ruby_selected.rc != 0
become_user: "{{ username }}"

View file

@ -3,24 +3,24 @@
debug:
msg: "{{ tomcat_instance_name }}"
- name: Check use of gid
shell: id -ng "{{ tomcat_instance_port }}"
- name: Check use of gid
command: id -ng "{{ tomcat_instance_port }}"
register: check_port_gid
changed_when: false
failed_when:
- check_port_gid|success
- check_port_gid.stdout != "{{ tomcat_instance_name }}"
- name: Check use of uid
shell: id -nu "{{ tomcat_instance_port }}"
- name: Check use of uid
command: id -nu "{{ tomcat_instance_port }}"
register: check_port_uid
changed_when: false
failed_when:
- check_port_uid|success
- check_port_uid.stdout != "{{ tomcat_instance_name }}"
#- name: Check use of http port
# shell: grep '<Connector port="{{ tomcat_instance_port }}" protocol="HTTP/1.1"' $(ls {{ tomcat_instance_root }}/*/conf/server.xml|grep -v {{ tomcat_instance_name }})
#- name: Check use of http port
# command: grep '<Connector port="{{ tomcat_instance_port }}" protocol="HTTP/1.1"' $(ls {{ tomcat_instance_root }}/*/conf/server.xml|grep -v {{ tomcat_instance_name }})
- name: Set shutdown port (default=http port + 1)
set_fact: