Commit cd4dcb2
committed
Add example to use host parameters via Ansible (#4037)
Example error if host parameter is unset:
fatal: [foreman.example.com]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'ansible.vars.hostvars.HostVarsVars object' has no attribute '_My_Host_Parameter_'. 'ansible.vars.hostvars.HostVarsVars object' has no attribute '_My_Host_Parameter_'\n\nThe error appears to be in '/tmp/d20250922-101358-j1ipdv/project/playbook.yml': line 5, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n tasks:\n - name: \"View a host parameter\"\n ^ here\n"}
Example REX output:
TASK [View a host parameter] ***************************************************
ok: [foreman.example.com] => {
"msg": "_Value_of_My_Host_Parameter_"
}
(cherry picked from commit 335131b)1 parent 6797979 commit cd4dcb2
File tree
3 files changed
+29
-0
lines changed- guides
- common/modules
- doc-Managing_Configurations_Ansible
3 files changed
+29
-0
lines changedLines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
| |||
0 commit comments