Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 1458018 - [RFE] Enable ansible logging by default
[RFE] Enable ansible logging by default
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Installer (Show other bugs)
3.0.0
Unspecified Unspecified
unspecified Severity high
: ---
: 3.11.0
Assigned To: Scott Dodson
Johnny Liu
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-06-01 15:06 EDT by Eric Jones
Modified: 2018-10-11 03:19 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
The ansible.cfg file distributed with openshift-ansible now sets a default log path of ~/openshift-ansible.log. This ensures that logs are written in a predictable location by default. In order to use the distributed ansible.cfg file you must first change directories to /usr/share/ansible/openshift-ansible before running playbooks. This ansible.cfg also sets other options meant to increase performance and reliability of openshift-ansible.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-10-11 03:19:06 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:2652 None None None 2018-10-11 03:19 EDT

  None (edit)
Description Eric Jones 2017-06-01 15:06:52 EDT
- What is the nature and description of the request? 
As an admin I require the ability to run Ansible playbooks and collect the logs at a later point.

- Why does the customer need this? (List the business requirements here) 
Because it is off by default so if you don't save the stdout, the details generated are gone quickly.

- How would the customer like to achieve this? (List the functional requirements here) 
Turn on the config setting in /etc/ansible/ansible.cfg (line 92 with ansible 2.2.3.0-1.el7.noarch installed)

- For each functional requirement listed, specify how Red Hat and the customer can test to confirm the requirement is successfully implemented.
Install ansible and have the logging setting enabled already

- Is there already an existing RFE upstream or in Red Hat Bugzilla?
no
Comment 8 Eric Rich 2017-12-21 12:02:22 EST
Is the suggestion here that OpenShift override the default ansible configuration files so that they log anible run's to logs by default?
Comment 9 Ryan Brown 2017-12-21 12:41:47 EST
Ansible takes configuration from projects as well. For example, if we had the OpenShift install playbooks in a directory like this: 


os-ansible-installer/
  - roles/
    - roleA/
    - roleB/
  - vars/
    - main.yml
    - site_vault.yml
  - install_openshift_playbook.yml
  - ansible.cfg

If, in the ansible.cfg, the OpenShift team supplied overrides to Ansible's logging options, then runs of `install_openshift_playbook.yml` would pick up those and any other configs in ansible.cfg. So there's no need to override system config.
Comment 10 Eric Rich 2017-12-21 13:06:57 EST
(In reply to Ryan Brown from comment #9)
> If, in the ansible.cfg, the OpenShift team supplied overrides to Ansible's
> logging options, then runs of `install_openshift_playbook.yml` would pick up
> those and any other configs in ansible.cfg. So there's no need to override
> system config.

Here: https://github.com/openshift/openshift-ansible/blob/master/ansible.cfg#L10
Comment 12 Scott Dodson 2018-01-19 14:22:52 EST
We need to update ansible.cfg to ensure that it logs and update the documentation to have them change directories to /usr/share/ansible/openshift-ansible prior to running playbooks.
Comment 13 Scott Dodson 2018-07-18 14:34:22 EDT
https://github.com/openshift/openshift-ansible/pull/9247

Sets log path to ~/openshift-ansible.log

We'll open a docs pr that instructs people to cd /usr/share/ansible/openshift-ansible prior to running playbooks.
Comment 14 Johnny Liu 2018-08-03 04:35:07 EDT
Verified this bug with openshift-ansible-3.11.0-0.10.0.git.0.91bb588None.noarch, and PASS.

# pwd
/usr/share/ansible/openshift-ansible

# cat ansible.cfg
<--snip-->
[defaults]
# Set the log_path
log_path = ~/openshift-ansible.log
<--snip-->

# cat ~/openshift-ansible.log
cat: /root/openshift-ansible.log: No such file or directory

# ansible-playbook -i /tmp/qe-inventory-host-file playbooks/openshift-checks/pre-install.yml

# ll ~/openshift-ansible.log
-rw-r--r--. 1 root root 75873 Aug  3 04:27 /root/openshift-ansible.log
Comment 16 errata-xmlrpc 2018-10-11 03:19:06 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:2652

Note You need to log in before you can comment on or make changes to this bug.