use YAML syntax

parent a2ce7bd7
...@@ -19,64 +19,80 @@ ...@@ -19,64 +19,80 @@
# #
# hadoop_common: Sqoop can distribute snapshotting work out to a cluster of workers, it uses Hadoop to do so. # hadoop_common: Sqoop can distribute snapshotting work out to a cluster of workers, it uses Hadoop to do so.
- name: Check if downloaded and extracted
- name: check if downloaded and extracted stat:
stat: path={{ SQOOP_LIB }}/mysql-connector-java-{{ SQOOP_MYSQL_CONNECTOR_VERSION }}-bin.jar path: "{{ SQOOP_LIB }}/mysql-connector-java-{{ SQOOP_MYSQL_CONNECTOR_VERSION }}-bin.jar"
register: installed register: installed
- name: distribution downloaded - name: distribution downloaded
get_url: > get_url:
url={{ sqoop_dist.url }} url: "{{ sqoop_dist.url }}"
sha256sum={{ sqoop_dist.sha256sum }} sha256sum: "{{ sqoop_dist.sha256sum }}"
dest={{ sqoop_temporary_dir }} dest: "{{ sqoop_temporary_dir }}"
when: not installed.stat.exists when: not installed.stat.exists
- name: distribution extracted - name: Distribution extracted
shell: > unarchive:
chdir={{ HADOOP_COMMON_USER_HOME }} src: "{{ sqoop_temporary_dir }}/{{ sqoop_dist.filename }}"
tar -xzf {{ sqoop_temporary_dir }}/{{ sqoop_dist.filename }} && chown -R {{ hadoop_common_user }}:{{ hadoop_common_group }} {{ sqoop_base_filename }} dest: "{{ HADOOP_COMMON_USER_HOME }}"
copy: no
when: not installed.stat.exists when: not installed.stat.exists
- name: versioned directory symlink created - name: Set the Permission
file: > shell: chown -R {{ hadoop_common_user }}:{{ hadoop_common_group }} {{ sqoop_base_filename }}
src={{ HADOOP_COMMON_USER_HOME }}/{{ sqoop_base_filename }} args:
dest={{ SQOOP_HOME }} chdir: "{{ HADOOP_COMMON_USER_HOME }}"
owner={{ hadoop_common_user }} group={{ hadoop_common_group }} state=link when: not installed.stat.exists
- name: mysql connector distribution downloaded - name: Versioned directory symlink created
get_url: > file:
url={{ sqoop_mysql_connector_dist.url }} src: "{{ HADOOP_COMMON_USER_HOME }}/{{ sqoop_base_filename }}"
sha256sum={{ sqoop_mysql_connector_dist.sha256sum }} dest: "{{ SQOOP_HOME }}"
dest={{ sqoop_temporary_dir }} owner: "{{ hadoop_common_user }}"
group: "{{ hadoop_common_group }}"
state: link
- name: MySQL connector distribution downloaded
get_url:
url: "{{ sqoop_mysql_connector_dist.url }}"
sha256sum: "{{ sqoop_mysql_connector_dist.sha256sum }}"
dest: "{{ sqoop_temporary_dir }}"
when: not installed.stat.exists when: not installed.stat.exists
- name: mysql connector distribution extracted - name: MySQL connector distribution extracted
shell: > unarchive:
chdir={{ sqoop_temporary_dir }} src: "{{ sqoop_temporary_dir }}/{{ sqoop_mysql_connector_dist.filename }}"
tar -xzf {{ sqoop_temporary_dir }}/{{ sqoop_mysql_connector_dist.filename }} dest: "{{ sqoop_temporary_dir }}"
copy: no
when: not installed.stat.exists when: not installed.stat.exists
- name: sqoop lib exists - name: Sqoop lib exists
file: > file:
path={{ SQOOP_LIB }} path: "{{ SQOOP_LIB }}"
owner={{ hadoop_common_user }} group={{ hadoop_common_group }} state=directory state: directory
owner: "{{ hadoop_common_user }}"
group: {"{ hadoop_common_group }}"
- name: mysql connector installed - name: MySQL connector installed
shell: > shell: >
chdir=/{{ sqoop_temporary_dir }}/mysql-connector-java-{{ SQOOP_MYSQL_CONNECTOR_VERSION }}
cp mysql-connector-java-{{ SQOOP_MYSQL_CONNECTOR_VERSION }}-bin.jar {{ SQOOP_LIB }} && cp mysql-connector-java-{{ SQOOP_MYSQL_CONNECTOR_VERSION }}-bin.jar {{ SQOOP_LIB }} &&
chown {{ hadoop_common_user }}:{{ hadoop_common_group }} {{ SQOOP_LIB }}/mysql-connector-java-{{ SQOOP_MYSQL_CONNECTOR_VERSION }}-bin.jar chown {{ hadoop_common_user }}:{{ hadoop_common_group }} {{ SQOOP_LIB }}/mysql-connector-java-{{ SQOOP_MYSQL_CONNECTOR_VERSION }}-bin.jar
args:
chdir: "/{{ sqoop_temporary_dir }}/mysql-connector-java-{{ SQOOP_MYSQL_CONNECTOR_VERSION }}"
when: not installed.stat.exists when: not installed.stat.exists
- name: configuration installed - name: Configuration installed
template: > template:
src={{ item }}.j2 src: "{{ item }}.j2"
dest={{ SQOOP_CONF }}/{{ item }} dest: "{{ SQOOP_CONF }}/{{ item }}"
mode=0640 owner={{ hadoop_common_user }} group={{ hadoop_common_group }} mode: "0640"
owner: "{{ hadoop_common_user }}"
group: "{{ hadoop_common_group }}"
with_items: with_items:
- sqoop-env.sh - sqoop-env.sh
- name: env vars sourced in hadoop env - name: env vars sourced in hadoop env
lineinfile: > lineinfile:
dest={{ hadoop_common_env }} state=present dest: "{{ hadoop_common_env }}"
regexp="^. {{ SQOOP_CONF }}/sqoop-env.sh" line=". {{ SQOOP_CONF }}/sqoop-env.sh" state: present
regexp: "^. {{ SQOOP_CONF }}/sqoop-env.sh" line=". {{ SQOOP_CONF }}/sqoop-env.sh"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment