Avoid unconditional fact gathering
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
Showing
- ansible/baremetal-compute-serial-console.yml 1 addition, 0 deletionsansible/baremetal-compute-serial-console.yml
- ansible/ip-allocation.yml 1 addition, 0 deletionsansible/ip-allocation.yml
- ansible/kayobe-ansible-user.yml 1 addition, 0 deletionsansible/kayobe-ansible-user.yml
- ansible/kayobe-target-venv.yml 12 additions, 0 deletionsansible/kayobe-target-venv.yml
- ansible/kolla-target-venv.yml 1 addition, 1 deletionansible/kolla-target-venv.yml
- ansible/network.yml 0 additions, 1 deletionansible/network.yml
- ansible/roles/swift-rings/tasks/main.yml 1 addition, 0 deletionsansible/roles/swift-rings/tasks/main.yml
- releasenotes/notes/avoid-unconditional-fact-gathering-4dfbf96e2111ad51.yaml 7 additions, 0 deletions.../avoid-unconditional-fact-gathering-4dfbf96e2111ad51.yaml
Please register or sign in to comment