Skip to content

Instantly share code, notes, and snippets.

@vicenteg
Last active August 15, 2016 14:03
Show Gist options
  • Save vicenteg/1b110cfd467d64487a16385ec10bdb42 to your computer and use it in GitHub Desktop.
Save vicenteg/1b110cfd467d64487a16385ec10bdb42 to your computer and use it in GitHub Desktop.
# Requires hadoop_properties: https://github.com/vicenteg/ansible-library
# Clone the repo to a library directory along side this playbook
# e.g.,
# mkdir mapr_to_s3 && cd mapr_to_s3 &&\
# curl -L 'https://gist.githubusercontent.com/vicenteg/1b110cfd467d64487a16385ec10bdb42/raw/f20770712d90696e817cb8725181dcbb5c146020/configure_mapr_core_site_xml_for_s3.yml' -o configure_mapr_core_site_xml_for_s3.yml &&\
# git clone https://github.com/vicenteg/ansible-library.git library
#
# Add your access key and secret key.
#
# You may need to change the group to match whatever you've named the
# entire cluster (all nodes) in your inventory. In my case it's `cluster`.
# This needs to be done to all cluster nodes.
# ansible -i inventory configure_mapr_core_site_xml_for_s3.yml
- hosts: cluster
tasks:
- name: update s3 properties in core-site.xml
become: true
become_user: root
hadoop_properties: create=True name="{{item.key}}" value="{{item.value}}" file=/opt/mapr/hadoop/hadoop-2.7.0/etc/hadoop/core-site.xml
with_dict:
fs.s3a.access.key: YOUR_ACCESS_KEY_HERE
fs.s3a.secret.key: YOUR_SECRET_KEY_HERE
fs.s3a.connection.ssl.enabled: True
#fs.s3a.proxy.host: 172.16.1.58
#fs.s3a.proxy.port: 3128
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment