ansible playbook post deployment

- name: Start service httpd, if not started
  service:
    name: httpd
    state: started

- name: Stop service httpd, if started
  service:
    name: httpd
    state: stopped

- name: Restart service httpd, in all cases
  service:
    name: httpd
    state: restarted

- name: Reload service httpd, in all cases
  service:
    name: httpd
    state: reloaded

- name: Enable service httpd, and not touch the state
  service:
    name: httpd
    enabled: yes

- name: Start service foo, based on running process /usr/bin/foo
  service:
    name: foo
    pattern: /usr/bin/foo
    state: started

- name: Restart network service for interface eth0
  service:
    name: network
    state: restarted
    args: eth0

0
0
Awgiedawgie 440220 points

                                    ps -aef|grep ClientProvision.exe
if it is running we can go & check in logs as well
cd /opt/Logs/dmApp
current hour application log we can grep & see printing in logs
date=date '+%d-%m-%y_%H_'
cat ClientProv_30xcf_$date *.log |grep "Loading InRoamer Details.."
if it is returing result as below we can ensure it is up & running fine
[InRoamer.cpp|00040|05:06:34:396|DG]Loading InRoamer Details
date=date '+%d_%m_%Y_05_'
#echo $date
cd /opt/Logs/dmApp
logfile=ClientProv_30xcf_$date*.log
#echo $logfile
cat $logfile |grep "Loading InRoamer Details.."

0
0
Are there any code examples left?
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source