Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vars:
- amazon_linux_ami: "ami-fb8e9292"
- user_data_file: "base-ami-userdata.sh"
- tasks:
- - name: user_data_contents
- shell: cat {{ user_data_file }}
- register: user_data_action
- - name: launch ec2-instance
- local_action:
- ...
- user_data: "{{ user_data_action.stdout }}"
- user_data: "{{ lookup('file', user_data_file) }}"
- - hosts: all
- vars:
- contents: "{{ lookup('file', '/etc/foo.txt') }}"
- tasks:
- - debug: msg="the value of foo.txt is {{ contents }}"
- vars:
- amazon_linux_ami: "ami-fb8e9292"
- user_data_file: "base-ami-userdata.sh"
- tasks:
- - name: Load data
- slurp:
- src: "{{ user_data_file }}"
- register: slurped_user_data
- - name: Decode data and store as fact # You can skip this if you want to use the right hand side directly...
- set_fact:
- user_data: "{{ slurped_user_data.content | b64decode }}"
Add Comment
Please, Sign In to add comment