Bug 1458018 - [RFE] Enable ansible logging by default
Summary: [RFE] Enable ansible logging by default
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Installer
Version: 3.0.0
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: 3.11.0
Assignee: Scott Dodson
QA Contact: Johnny Liu
Depends On:
TreeView+ depends on / blocked
Reported: 2017-06-01 19:06 UTC by Eric Jones
Modified: 2018-10-11 07:19 UTC (History)
7 users (show)

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.
Clone Of:
Last Closed: 2018-10-11 07:19:06 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:2652 0 None None None 2018-10-11 07:19:41 UTC

Description Eric Jones 2017-06-01 19:06:52 UTC
- 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 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?

Comment 8 Eric Rich 2017-12-21 17:02:22 UTC
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 17:41:47 UTC
Ansible takes configuration from projects as well. For example, if we had the OpenShift install playbooks in a directory like this: 

  - 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 18:06:57 UTC
(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 19:22:52 UTC
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 18:34:22 UTC

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 08:35:07 UTC
Verified this bug with openshift-ansible-3.11.0-0.10.0.git.0.91bb588None.noarch, and PASS.

# pwd

# cat ansible.cfg
# Set the log_path
log_path = ~/openshift-ansible.log

# 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 07:19:06 UTC
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.


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