Skip to content
Snippets Groups Projects
  • Mark Goddard's avatar
    e924c99c
    Avoid unconditional fact gathering · e924c99c
    Mark Goddard authored
    One way to improve the performance of Ansible is through fact caching.
    Rather than gather facts in every play, we can configure Ansible to
    cache them in a persistent store. An example Ansible configuration for
    doing this is as follows:
    
    [defaults]
    gathering = smart
    fact_caching = jsonfile
    fact_caching_connection = ./facts
    fact_caching_timeout = 86400
    
    While this mostly just works, there are a few places where we
    unconditionally gather facts using the setup module. This change
    modifies these to only gather facts when necessary.
    
    We no longer execute the MichaelRigart.interfaces role using become:
    true, since it may gather facts and we do not want it to do so as root.
    The role uses become where necessary.
    
    Change-Id: I9984a187fc6c0496ada489bb8eef36e44d695aac
    Story: 2007492
    Task: 39216
    e924c99c
    History
    Avoid unconditional fact gathering
    Mark Goddard authored
    One way to improve the performance of Ansible is through fact caching.
    Rather than gather facts in every play, we can configure Ansible to
    cache them in a persistent store. An example Ansible configuration for
    doing this is as follows:
    
    [defaults]
    gathering = smart
    fact_caching = jsonfile
    fact_caching_connection = ./facts
    fact_caching_timeout = 86400
    
    While this mostly just works, there are a few places where we
    unconditionally gather facts using the setup module. This change
    modifies these to only gather facts when necessary.
    
    We no longer execute the MichaelRigart.interfaces role using become:
    true, since it may gather facts and we do not want it to do so as root.
    The role uses become where necessary.
    
    Change-Id: I9984a187fc6c0496ada489bb8eef36e44d695aac
    Story: 2007492
    Task: 39216