ansible store shell return code
- hosts: localhost
gather_facts: no
#strategy: debug
tasks:
- name: run this command and ignore the result
shell: ping -c 1 8.8.8.8
register: pingout
ignore_errors: yes
- debug: msg="{{ pingout.rc }}"
- name: Prepare well output
raw: echo "What a wonderful world"
register: output
when: pingout.rc == 0
- debug: var=output
- name: run this command and ignore the result
raw: ping -c 1 8.8.8.7
register: pingout2
ignore_errors: yes
- debug: msg="{{ pingout2.rc }}"
- name: run this command if something wrong
shell: echo "Something goes wrong :)"
register: output2
when: pingout2.rc != 0
- debug: var=output2
Also in C++:
- docker install in centos u7
- brew install npm
- why my github user not showing photo in commit
- how do i see the list of packages installed on anaconda
- bash search and replace text in file
- grep line after match
- how to install specific version of software on mac using brew
- git ls files sort by date
- pip install scrapy-proxy-pool
- install babel core
- More than one DbContext was found. Specify which one to use. Use the '-Context' parameter for PowerShell commands and the '--context' parameter for dotnet commands.
- install networkx python
- * Connection #0 to host artifactory-us.cytiva.net left intact
- docker run ubuntu container
- bash vlookup function
- git abort changes
- ubuntu dpkg path
- sudo update
- acce;lerate ubuntu
- npm default init
- ubuntu mysql-server default root password
- ef remove migration
- how to add a group windows powershell
- install postman in ubuntu 20.04