Right now I have a role/common that does a lot of "discovery" about the machine. It does things like looks at the hostname and sets "machine_env" to dev/qa/prod. It also does a lot of discovery to see what applications are installed and/or running on the box and then sets facts like "systemd_nginx_enabled: true" if nginx is enabled in systemd. This all works fine, but there are like 30 checks that I am doing (for all the different apps etc) and it seems to add like 20m+ to the ansible run when I have a lot of machines.
It seems like it would be WAY more efficient to write a script that would quickly do the machine discovery and then output something like: machine_env: prod systemd_nginx_enabled: true systemd_mongodb_enabled: false systemd_redis_enabled: false systemd_consul_enabled: true systemd_apache_enabled: false systemd_zookeeper_enabled: false ... where the output could be iterated over and the respective facts are then set. Is this possible? I am thinking it is some incantation with "map" and "list", but I don't know exactly how to do it. Thanks! -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/543af15a-12bc-488d-a051-d3e6a9a77411%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
