geerlingguy / geerlingguy/ansible-for-devops

Chapter 3: CHANGED vs SUCCESS

Open
#549 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
9.9k
Forks
3.8k
PR merge metrics
No merged PRs in 30d

Description

In `Make changes using Ansible modules` section:

for the first command, when running fresh, I get only `SUCCESS` not `CHANGED` as said in the book.

```
$ ansible multi -b -m dnf -a "name=chrony state=present"
192.168.56.4 | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/libexec/platform-python"
},
"changed": false,
"msg": "Nothing to do",
"rc": 0,
"results": []
}
192.168.56.5 | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/libexec/platform-python"
},
"changed": false,
"msg": "Nothing to do",
"rc": 0,
"results": []
}
192.168.56.6 | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/libexec/platform-python"
},
"changed": false,
"msg": "Nothing to do",
"rc": 0,
"results": []
}
```

And for the second, when running fresh,

```
ansible multi -b -m service -a "name=chronyd state=started enabled=yes"
192.168.56.4 | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/libexec/platform-python"
},
"changed": false,
"enabled": true,
"name": "chronyd",
"state": "started",
...
```

Instead of `"changed": true` as said in the book,
I get `false`!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.