c2platform / c2platform.dev / 1.0.1 / module / vagrant_hosts Creates hosts file content for Vagrant guests and the host. | "added in version" 1.0.0 of c2platform.dev" Authors: onknowsc2platform.dev.vagrant_hosts (1.0.1) — module
Install with ansible-galaxy collection install c2platform.dev:==1.0.1
collections: - name: c2platform.dev version: 1.0.1
This module accepts as a parameter the location of a Vagrantfile.yml. See [Vagrant | C2 Platform](https://c2platform.org/docs/concepts/dev/vagrant/).
Based on that it creates content for hosts file of Vagrant guests and the Vagrant host.
It returns this content as an Ansible fact `vagrant_hosts_content`.
- name: Generate hosts file content from Vagrantfile.yml c2platform.dev.vagrant_hosts: vagrantfile_yml: "{{ inventory_dir }}/Vagrantfile.yml"
vagrantfile_yml: description: - The path to a Vagrantfile.yml required: true type: str
vagrant_hosts_content: description: Content for /etc/hosts returned: when successful sample: '1.1.5.205 gsd-rproxy1 gsd-rproxy1.internal.c2platform.org webproxy.c2platform.org helloworld.c2platform.org 1.1.5.208 gsd-checkmk-server gsd-checkmk-server.internal.c2platform.org ' type: str