On my system configuration there was no proxy present and the sysinv-utils script fails to treat this case. Moreover, the script returns 0 when it shouldn't and the playbook fails to catch the error.
2019-11-22 16:17:54,405 p=1187653 u=sysadmin | TASK [backup/backup-system : Create the override backup file] ***********************************************************************************************
2019-11-22 16:17:54,405 p=1187653 u=sysadmin | task path: /usr/share/ansible/stx-ansible/playbooks/roles/backup/backup-system/tasks/main.yml:228
2019-11-22 16:17:54,496 p=1187653 u=sysadmin | Using module file /usr/lib/python2.7/site-packages/ansible/modules/commands/command.py
2019-11-22 16:18:00,053 p=1187653 u=sysadmin | changed: [localhost] => {
"changed": true,
"cmd": [ "/usr/bin/sysinv-utils", "create-host-overrides", "/opt/backups/ansible.LIi4FG/override/localhost_override_backup.yml"
],
"delta": "0:00:05.286237",
"end": "2019-11-22 16:18:00.005991",
"failed_when_result": false,
"invocation": { "module_args": { "_raw_params": "/usr/bin/sysinv-utils create-host-overrides /opt/backups/ansible.LIi4FG/override/localhost_override_backup.yml", "_uses_shell": false,
"argv": null, "chdir": null, "creates": null, "executable": null, "removes": null, "stdin": null,
"warn": true
}
},
"rc": 0,
"start": "2019-11-22 16:17:54.719754",
"stderr": "",
"stderr_lines": [],
"stdout": "sysinv 2019-11-22 16:17:59.775 1202266 ERROR sysinv.cmd.utils [-] Resource could not be found.: NotFound: Resource could not be found.\u001b[00m",
"stdout_lines": [
"sysinv 2019-11-22 16:17:59.775 1202266 ERROR sysinv.cmd.utils [-] Resource could not be found.: NotFound: Resource could not be found.\u001b[00m"
]
}
Because the sysinv-utils script does not create the localhost_override_backup.yml file, the playbook generates an error later when a task tries to write to the yml file.
Steps to Reproduce
------------------
Run the backup playbook:
ansible-playbook /usr/share/ansible/stx-ansible/playbooks/backup.yml -e "ansible_become_pass=Li69nux* admin_password=Li69nux*"
Expected Behavior
------------------
The playbook should run succesfully
Actual Behavior
----------------
The playbook run failed
Reproducibility
---------------
100% reproducible
System Configuration
--------------------
One node system
Brief Description /opendev. org/starlingx/ config/ commit/ 65dfc46b9b0f08e 9515970268c50fa 5027d4c442.
-----------------
I think this issue was introducer by https:/
On my system configuration there was no proxy present and the sysinv-utils script fails to treat this case. Moreover, the script returns 0 when it shouldn't and the playbook fails to catch the error.
2019-11-22 16:17:54,405 p=1187653 u=sysadmin | TASK [backup/ backup- system : Create the override backup file] ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* **** ansible/ stx-ansible/ playbooks/ roles/backup/ backup- system/ tasks/main. yml:228 python2. 7/site- packages/ ansible/ modules/ commands/ command. py
"/usr/ bin/sysinv- utils",
"create- host-overrides" ,
"/opt/ backups/ ansible. LIi4FG/ override/ localhost_ override_ backup. yml" when_result" : false,
"module_ args": {
"_ raw_params" : "/usr/bin/ sysinv- utils create- host-overrides /opt/backups/ ansible. LIi4FG/ override/ localhost_ override_ backup. yml",
"_ uses_shell" : false,
"chdir" : null,
"creates" : null,
"executabl e": null,
"removes" : null,
"stdin" : null,
2019-11-22 16:17:54,405 p=1187653 u=sysadmin | task path: /usr/share/
2019-11-22 16:17:54,496 p=1187653 u=sysadmin | Using module file /usr/lib/
2019-11-22 16:18:00,053 p=1187653 u=sysadmin | changed: [localhost] => {
"changed": true,
"cmd": [
],
"delta": "0:00:05.286237",
"end": "2019-11-22 16:18:00.005991",
"failed_
"invocation": {
"argv": null,
"warn": true
}
},
"rc": 0,
"start": "2019-11-22 16:17:54.719754",
"stderr": "",
"stderr_lines": [],
"stdout": "sysinv 2019-11-22 16:17:59.775 1202266 ERROR sysinv.cmd.utils [-] Resource could not be found.: NotFound: Resource could not be found.\u001b[00m",
"stdout_lines": [
"sysinv 2019-11-22 16:17:59.775 1202266 ERROR sysinv.cmd.utils [-] Resource could not be found.: NotFound: Resource could not be found.\u001b[00m"
]
}
Because the sysinv-utils script does not create the localhost_ override_ backup. yml file, the playbook generates an error later when a task tries to write to the yml file.
2019-11-22 16:18:35,679 p=1187653 u=sysadmin | TASK [backup/ backup- system : Append registries configuration] ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* **** ansible/ stx-ansible/ playbooks/ roles/backup/ backup- system/ tasks/main. yml:240 python2. 7/site- packages/ ansible/ modules/ files/blockinfi le.py
"module_ args": {
"attribute s": null,
"backup" : false,
"block" : "docker_ registries: \n docker.elastic.co: {}\n docker.io: {}\n gcr.io: {}\n k8s.gcr.io: {}\n quay.io: {}\n",
"content" : null,
"create" : false,
"delimiter ": null,
"directory _mode": null,
"follow" : false,
"force" : null,
"group" : null,
"insertaft er": null,
"insertbef ore": null,
"marker" : "",
"marker_ begin": "BEGIN",
"marker_ end": "END",
"owner" : null, ansible. LIi4FG/ override/ localhost_ override_ backup. yml",
"regexp" : null,
"remote_ src": null,
"selevel" : null,
"serole" : null,
"setype" : null,
"seuser" : null,
"state" : "present",
"unsafe_ writes" : null,
"validate" : null ansible. LIi4FG/ override/ localhost_ override_ backup. yml does not exist !",
2019-11-22 16:18:35,679 p=1187653 u=sysadmin | task path: /usr/share/
2019-11-22 16:18:36,157 p=1187653 u=sysadmin | Using module file /usr/lib/
2019-11-22 16:18:36,495 p=1187653 u=sysadmin | fatal: [localhost]: FAILED! => {
"changed": false,
"invocation": {
"mode": null,
"path": "/opt/backups/
"src": null,
}
},
"msg": "Path /opt/backups/
"rc": 257
}
Severity
--------
Critical
Steps to Reproduce ansible/ stx-ansible/ playbooks/ backup. yml -e "ansible_ become_ pass=Li69nux* admin_password= Li69nux* "
------------------
Run the backup playbook:
ansible-playbook /usr/share/
Expected Behavior
------------------
The playbook should run succesfully
Actual Behavior
----------------
The playbook run failed
Reproducibility
---------------
100% reproducible
System Configuration ------- ------
-------
One node system
Branch/Pull Time/Commit ------- ------- -- "Unknown" "Informal"
-------
SW_VERSION="19.09"
BUILD_TARGET=
BUILD_TYPE=
BUILD_ID="n/a"
JOB="n/a" "358e067817c0" "2019-11- 22 08:44:28 +0000"
BUILD_BY="jenkins"
BUILD_NUMBER="n/a"
BUILD_HOST=
BUILD_DATE=
BUILD_DIR="/" DIR="/localdisk /designer/ jenkins/ test/cgcs- root" BRANCH= "HEAD" DIR="/localdisk /designer/ jenkins/ test/cgcs- root/stx" BRANCH= "HEAD"
WRS_SRC_
WRS_GIT_
CGCS_SRC_
CGCS_GIT_