This file contains 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
- hosts: httpd | |
vars_files: | |
- "{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_major_version'] }}.yml" | |
tasks: | |
- name: Install web server software | |
package: | |
name: "{{ package_name }}" | |
state: present |
This file contains 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
package_name: apache2 | |
service_name: apache2 | |
doc_root: /var/www/html |
This file contains 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
package_name: httpd | |
service_name: httpd | |
doc_root: /var/www/html |
This file contains 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
Listen {{ http_port }} | |
<Virtualhost {{ ansible_facts['default_ipv4']['address'] }}:{{ http_port }}> | |
DocumentRoot {{ doc_root }} | |
</Virtualhost> |
This file contains 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
- hosts: httpd | |
vars_prompt: | |
- name: "doc_root" | |
prompt: "Enter document root name " | |
private: no | |
- name: "http_port" | |
prompt: "Enter port no " | |
private: no | |
tasks: |
This file contains 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
- hosts: webserver | |
tasks: | |
- name: "installing the httpd server" | |
package: | |
name: "httpd" | |
state: present | |
- name: "installing the php on the webserver" | |
package: | |
name: "php" |
This file contains 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
hadoop_path: "/home/ec2-user/hadoop-1.2.1-1.x86_64.rpm" | |
jdk_path: "/home/ec2-user/jdk-8u171-linux-x64.rpm" | |
hadoop_software: "/root/hadoop-1.2.1-1.x86_64.rpm" | |
jdk_software: "/root/jdk-8u171-linux-x64.rpm" | |
core_site: "/home/ec2-user/client_files/core-site.xml" |
This file contains 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
- hosts: client | |
vars_files: | |
- client_var.yml | |
tasks: | |
- name: "Copying the hadoop File" | |
copy: | |
src: "{{ hadoop_path }}" | |
dest: "/root/" | |
- name: "Copying the JDK File" | |
copy: |
This file contains 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
hadoop_path: "/home/ec2-user/hadoop-1.2.1-1.x86_64.rpm" | |
jdk_path: "/home/ec2-user/jdk-8u171-linux-x64.rpm" | |
hadoop_software: "/root/hadoop-1.2.1-1.x86_64.rpm" | |
jdk_software: "/root/jdk-8u171-linux-x64.rpm" | |
core_site: "/home/ec2-user/datanode_files/core-site.xml" |
This file contains 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
- hosts: datanode | |
vars_files: | |
- data_var.yml | |
tasks: | |
- name: "Copying the hadoop File" | |
copy: | |
src: "{{ hadoop_path }}" | |
dest: "/root/" | |
- name: "Copying the JDK File" | |
copy: |