Foreman-maintain service output in ansible


#1

I’m wondering about the output of foreman-maintain service that’s pretty verbose in forklift:

changed: [pipeline-upgrade-centos7] => changed=true 
  cmd:
  - katello-service
  - stop
  delta: '0:00:29.444363'
  end: '2018-12-04 18:59:46.793389'
  rc: 0
  start: '2018-12-04 18:59:17.349026'
  stderr: ''
  stderr_lines: []
  stdout: |-
    Redirecting to 'foreman-maintain service'
    Running Stop Services
    ================================================================================
    Check if command is run as root user:                                 [32m[1m[OK][0m
    --------------------------------------------------------------------------------
    Stop applicable services:
    Stopping the following service(s):
  
    postgresql, rh-mongodb34-mongod, qdrouterd, qpidd, squid, pulp_resource_manager, pulp_streamer, foreman-proxy, pulp_celerybeat, pulp_workers, tomcat, dynflowd, httpd, puppetserver
  
                                                                                    |                                                                                 /                                                                                 /                                                                                 -                                                                                 \                                                                                 |                                                                                 / stopping puppetserver                                                                                / stopping puppetserver                                                                                - stopping puppetserver                                                                                \ stopping puppetserver                                                                                | stopping puppetserver                                                                                / stopping puppetserver                                                                                - stopping puppetserver                                                                                \ stopping puppetserver                                                                                | stopping puppetserver                                                                                / stopping puppetserver                                                                                - stopping puppetserver                                                                                \ stopping puppetserver                                                                                | stopping puppetserver                                                                                / stopping httpd                                                                                / stopping httpd                                                                                - stopping httpd                                                                                \ stopping httpd                                                                                | stopping httpd                                                                                / stopping httpd                                                                                - stopping httpd                                                                                \ stopping httpd                                                                                | stopping httpd                                                                                / stopping httpd                                                                                - stopping httpd                                                                                \ stopping httpd                                                                                | stopping httpd                                                                                / stopping httpd                                                                                - stopping httpd                                                                                \ stopping httpd                                                                                | stopping httpd                                                                                / stopping httpd                                                                                - stopping httpd                                                                                \ stopping httpd                                                                                | stopping httpd                                                                                / stopping httpd                                                                                - stopping httpd                                                                                \ stopping httpd                                                                                | stopping httpd                                                                                / stopping httpd                                                                                - stopping httpd                                                                                \ stopping httpd                                                                                | stopping httpd                                                                                / stopping httpd                                                                                - stopping httpd                                                                                \ stopping httpd                                                                                | stopping httpd                                                                                / stopping httpd                                                                                - stopping httpd                                                                                \ stopping httpd                                                                                | stopping httpd                                                                                / stopping httpd                                                                                - stopping httpd                                                                                \ stopping httpd                                                                                | stopping httpd                                                                                / stopping httpd                                                                                - stopping httpd                                                                                \ stopping httpd                                                                                | stopping httpd                                                                                / stopping httpd                                                                                - stopping httpd                                                                                \ stopping httpd                                                                                | stopping httpd                                                                                / stopping httpd                                                                                - stopping httpd                                                                                \ stopping httpd                                                                                | stopping httpd                                                                                / stopping httpd                                                                                - stopping httpd                                                                                \ stopping httpd                                                                                | stopping httpd                                                                                / stopping httpd                                                                                - stopping httpd                                                                                \ stopping httpd                                                                                | stopping httpd                                                                                / stopping httpd                                                                                - stopping httpd                                                                                \ stopping httpd                                                                                | stopping httpd                                                                                / stopping httpd                                                                                - stopping httpd                                                                                \ stopping httpd                                                                                | stopping httpd                                                                                / stopping httpd                                                                                - stopping httpd                                                                                \ stopping httpd                                                                                | stopping httpd                                                                                / stopping httpd                                                                                - stopping httpd                                                                                \ stopping dynflowd                                                                                \ stopping dynflowd                                                                                | stopping dynflowd                                                                                / stopping dynflowd                                                                                - stopping dynflowd                                                                                \ stopping dynflowd                                                                                | stopping dynflowd                                                                                / stopping dynflowd                                                                                - stopping dynflowd                                                                                \ stopping dynflowd                                                                                | stopping dynflowd                                                                                / stopping dynflowd                                                                                - stopping dynflowd                                                                                \ stopping dynflowd                                                                                | stopping dynflowd                                                                                / stopping dynflowd                                                                                - stopping dynflowd                                                                                \ stopping dynflowd                                                                                | stopping dynflowd                                                                                / stopping dynflowd                                                                                - stopping dynflowd                                                                                \ stopping dynflowd                                                                                | stopping dynflowd                                                                                / stopping dynflowd                                                                                - stopping dynflowd                                                                                \ stopping dynflowd                                                                                | stopping dynflowd                                                                                / stopping dynflowd                                                                                - stopping dynflowd                                                                                \ stopping dynflowd                                                                                | stopping dynflowd                                                                                / stopping dynflowd                                                                                - stopping dynflowd                                                                                \ stopping dynflowd                                                                                | stopping dynflowd                                                                                / stopping dynflowd                                                                                - stopping dynflowd                                                                                \ stopping dynflowd                                                                                | stopping dynflowd                                                                                / stopping dynflowd                                                                                - stopping dynflowd                                                                                \ stopping dynflowd                                                                                | stopping dynflowd                                                                                / stopping dynflowd                                                                                - stopping dynflowd                                                                                \ stopping dynflowd                                                                                | stopping dynflowd                                                                                / stopping dynflowd                                                                                - stopping dynflowd                                                                                \ stopping dynflowd                                                                                | stopping dynflowd                                                                                / stopping dynflowd                                                                                - stopping dynflowd                                                                                \ stopping tomcat                                                                                \ stopping tomcat                                                                                | stopping tomcat                                                                                / stopping tomcat                                                                                - stopping tomcat                                                                                \ stopping tomcat                                                                                | stopping tomcat                                                                                / stopping tomcat                                                                                - stopping tomcat                                                                                \ stopping tomcat                                                                                | stopping tomcat                                                                                / stopping tomcat                                                                                - stopping tomcat                                                                                \ stopping tomcat                                                                                | stopping tomcat                                                                                / stopping tomcat                                                                                - stopping tomcat                                                                                \ stopping pulp_workers                                                                                \ stopping pulp_workers                                                                                | stopping pulp_workers                                                                                / stopping pulp_workers                                                                                - stopping pulp_workers                                                                                \ stopping pulp_workers                                                                                | stopping pulp_workers                                                                                / stopping pulp_workers                                                                                - stopping pulp_workers                                                                                \ stopping pulp_workers                                                                                | stopping pulp_workers                                                                                / stopping pulp_workers                                                                                - stopping pulp_workers                                                                                \ stopping pulp_workers                                                                                | stopping pulp_workers                                                                                / stopping pulp_workers                                                                                - stopping pulp_workers                                                                                \ stopping pulp_workers                                                                                | stopping pulp_workers                                                                                / stopping pulp_workers                                                                                - stopping pulp_workers                                                                                \ stopping pulp_workers                                                                                | stopping pulp_workers                                                                                / stopping pulp_workers                                                                                - stopping pulp_workers                                                                                \ stopping pulp_workers                                                                                | stopping pulp_workers                                                                                / stopping pulp_workers                                                                                - stopping pulp_workers                                                                                \ stopping pulp_workers                                                                                | stopping pulp_workers                                                                                / stopping pulp_workers                                                                                - stopping pulp_workers                                                                                \ stopping pulp_workers                                                                                | stopping pulp_workers                                                                                / stopping pulp_workers                                                                                - stopping pulp_celerybeat                                                                                - stopping pulp_celerybeat                                                                                \ stopping pulp_celerybeat                                                                                | stopping pulp_celerybeat                                                                                / stopping pulp_celerybeat                                                                                - stopping pulp_celerybeat                                                                                \ stopping foreman-proxy                                                                                \ stopping foreman-proxy                                                                                | stopping pulp_streamer                                                                                | stopping pulp_streamer                                                                                / stopping pulp_streamer                                                                                - stopping pulp_streamer                                                                                \ stopping pulp_resource_manager                                                                                \ stopping pulp_resource_manager                                                                                | stopping pulp_resource_manager                                                                                / stopping pulp_resource_manager                                                                                - stopping pulp_resource_manager                                                                                \ stopping pulp_resource_manager                                                                                | stopping pulp_resource_manager                                                                                / stopping pulp_resource_manager                                                                                - stopping pulp_resource_manager                                                                                \ stopping pulp_resource_manager                                                                                | stopping pulp_resource_manager                                                                                / stopping pulp_resource_manager                                                                                - stopping pulp_resource_manager                                                                                \ stopping pulp_resource_manager                                                                                | stopping pulp_resource_manager                                                                                / stopping pulp_resource_manager                                                                                - stopping pulp_resource_manager                                                                                \ stopping pulp_resource_manager                                                                                | stopping pulp_resource_manager                                                                                / stopping pulp_resource_manager                                                                                - stopping pulp_resource_manager                                                                                \ stopping pulp_resource_manager                                                                                | stopping pulp_resource_manager                                                                                / stopping pulp_resource_manager                                                                                - stopping pulp_resource_manager                                                                                \ stopping pulp_resource_manager                                                                                | stopping pulp_resource_manager                                                                                / stopping pulp_resource_manager                                                                                - stopping pulp_resource_manager                                                                                \ stopping pulp_resource_manager                                                                                | stopping pulp_resource_manager                                                                                / stopping pulp_resource_manager                                                                                - stopping pulp_resource_manager                                                                                \ stopping pulp_resource_manager                                                                                | stopping pulp_resource_manager                                                                                / stopping pulp_resource_manager                                                                                - stopping pulp_resource_manager                                                                                \ stopping pulp_resource_manager                                                                                | stopping pulp_resource_manager                                                                                / stopping pulp_resource_manager                                                                                - stopping pulp_resource_manager                                                                                \ stopping pulp_resource_manager                                                                                | stopping pulp_resource_manager                                                                                / stopping squid                                                                                / stopping qpidd                                                                                / stopping qpidd                                                                                - stopping qdrouterd                                                                                - stopping qdrouterd                                                                                \ stopping rh-mongodb34-mongod                                                                                \ stopping rh-mongodb34-mongod                                                                                | stopping rh-mongodb34-mongod                                                                                / stopping postgresql                                                                                / stopping postgresql                                                                                - stopping postgresql                                                                                \ stopping postgresql                                                                                | stopping postgresql                                                                                / stopping postgresql                                                                                - stopping postgresql                                                                                \ stopping postgresql                                                                                | stopping postgresql                                                                                / stopping postgresql                                                                                - stopping postgresql                                                                                \ stopping postgresql                                                                                | All services stopped                                                [32m[1m[OK][0m
    --------------------------------------------------------------------------------
  stdout_lines: <omitted>

It looks like a spinner is being shown which just appends. I’m not quite sure where this should be fixed though. Suggestions?


#2

I’ve seen this too in formena-maintain output from sat-clone (also uses ansible) as well. @mbacovsky may have some ideas on if/how we should improve this in foreman-maintain.


#3

Checking whether foreman-maintain has a TTY and disabling spinners and other interactive features if not (the output is redirected/being captured). The maybe less complicated solution would be to add a flag to disable this by hand.


#4

I agree with Adam, we should add both the TTY detection and some eye-candy-less mode switch to the foreman-maintain. I quite like how verbosity levels were consolidated in hammer recently, it may be time to do the same in foreman-maintain.

@ekohl, could you file this as an issue in foreman-maintain Redmine ?


#5

I’ve opened Feature #25630: Use TTY detection to set an appropriate output level - Foreman Maintain - Foreman