Ansible Notes: Difference between revisions
From Federal Burro of Information
Jump to navigationJump to search
No edit summary |
|||
Line 37: | Line 37: | ||
* [[Puppet Notes]] | * [[Puppet Notes]] | ||
* http://codeheaven.io/15-things-you-should-know-about-ansible/ |
Revision as of 02:15, 5 September 2017
output to one line:
cat /tmp/david/report.java | perl -n -e " $/ = '' ; print join ( ',' , split\"\n\" ) . \"\n\"; " | more
or -o :P
Git install
under rhel6:
cd ~ mkdir work yum install gcc python-devel git clone https://github.com/ansible/ansible.git git submodule update --init --recursive make install mkdir /etc/ansible vi /etc/ansible/hosts
Cloud-init to make tags facts
- path: /etc/facter/facts.d/tags.sh permissions: 0755 content: | #!/usr/bin/env bash instanceId=`curl http://169.254.169.254/latest/meta-data/instance-id 2>/dev/null` region=`curl http://169.254.169.254/latest/meta-data/placement/availability-zone 2>/dev/null | sed 's/[a-z]$//g'` /usr/bin/aws ec2 describe-tags --filters "Name=resource-id,Values=$instanceId" --region $region | jq '.Tags[] | "ec2_tag_" + .Key + "=" + .Value' | tr [:upper:] [:lower:] | tr -d '"' exit 0