Hello,
I use a lot the aws cloud and will like to have a module that will read the facts from the aws
metatdata server. This is present into ohai and facter. So looking to expose to ansible something like this
ansible_ec2_ami_id
ansible_ec2_ami_launch_index
ansible_ec2_ami_manifest_path
ansible_ec2_block_device_mapping_ami
ansible_ec2_block_device_mapping_root
ansible_ec2_hostname
ansible_ec2_instance_id
ansible_ec2_instance_type
ansible_ec2_kernel_id
ansible_ec2_local_hostname
ansible_ec2_local_ipv4
ansible_ec2_placement_availability_zone
ansible_ec2_profile
ansible_ec2_public_hostname
ansible_ec2_public_ipv4
ansible_ec2_public_keys_0_openssh_key
ansible_ec2_reservation_id
ansible_ec2_security_groups
ansible_ec2_userdata
With these available you can have a ‘general’ playbook that will execute based on the presence/absence of facts. For example if you are part of security group ‘backup’ than you can install a backup script and so on.
Please let me know what you think - thanks!
-silviu
Ok, so... I can see a native python module for getting facts to be a
very good idea, because you don't have to install Ruby. That being
said, I'm not terribly interested in including one in core, but if you
write one, we can easily put it up on the contrib page of useful
resources -- and it would be good to have.
That being said, yes you can use those other tools because the setup
module will run them automatically if installed...
So perhaps there is a documentation action here, using ec2 metadata as an example in the fact sections of docs?
So perhaps there is a documentation action here, using ec2 metadata as an
example in the fact sections of docs?
Unless I'm missing where I wrote it, we do mention their facts are
loaded if present already.
I'd rather have a native alternative really
Sounds like a mandate It would certainly be nice to be able to get this info without the dependencies facter requires.
Let us know if you start working on something Silviu
Hi,
Will start to work on it.
For the facter part I agree that is available however as it was mentioned requires ruby and gems
(and on centos 5.x is really a pain to have it done right because ruby 1.8.4 has a memory bug).
-silviu