Created
January 29, 2016 21:29
-
-
Save heaje/6e47f59c3d45643cd7bd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{%- from 'cloudera/hadoop/map.jinja' import hadoop with context %} | |
include: | |
- cloudera.common | |
{% for group, group_info in hadoop.group.items() %} | |
{{group}}_create: | |
group.present: | |
- name: {{ group_info.name|default(group) }} | |
- system: {{ group_info.system }} | |
{% if group_info.gid %} | |
- gid: {{ group_info.gid }} | |
{% endif %} | |
{% endfor %} | |
{% for user, user_info in hadoop.user.items() %} | |
{{ user }}_create: | |
user.present: | |
- name: {{ user_info.name|default(user) }} | |
- home: {{ user_info.home }} | |
- system: {{ user_info.system }} | |
- shell: {{ user_info.shell }} | |
{% if user_info.uid %} | |
- uid: {{ user_info.uid }} | |
{% endif %} | |
{% if 'groups' in user_info %} | |
- groups: {{ user_info.groups }} | |
{% endif %} | |
{% endfor %} | |
hadoop-base-pkg: | |
pkg.latest: | |
- name: {{ hadoop.package.hadoop.name|default('hadoop') }} | |
{% for config_file, info in hadoop['config'].items() %} | |
{{ hadoop.conf_dir ~ '/' ~ config_file }}: | |
file.managed: | |
{% if 'name' in info %} | |
- name: {{ info.name }} | |
{% endif %} | |
- user: {{ info.user|default('root') }} | |
- group: {{ info.group|default('root') }} | |
- mode: {{ info.mode|default(644) }} | |
- source: {{ info.source }} | |
- template: {{ info.template|default('jinja') }} | |
{% if 'contents' in info %} | |
- defaults: | |
instanceconf: {{ info.contents }} | |
{% endif %} | |
{% endfor %} | |
{{hadoop['config_params']['hadoop.tmp.dir']}}: | |
file.directory: | |
- user: {{hadoop.user.hdfs.name}} | |
- group: {{hadoop.group.hadoop.name}} | |
- makedirs: true | |
- dir_mode: 755 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment