I have created roles to install httpd.
But the status is always ‘ok=1’
instead of ‘changed=1’
How should I actually install httpd and get a status of ‘changed=1’
master.yml->
- name: playbook
hosts: webservers
become: yes
roles:
-tasks
tasks.yml->
- name: installing apache latest
yum:
- name: httpd
state: present
2
Answers
have you started your service?
this is because you have state "present" in yum-module description.
how it works: if you have package already installed – status will be "ok", if you have not – status will be "changed".