Skip to content

Instantly share code, notes, and snippets.

View ShubhamRasal's full-sized avatar
💻
Cooking software

Shubham Rasal ShubhamRasal

💻
Cooking software
View GitHub Profile
@ShubhamRasal
ShubhamRasal / webserver.yml
Created December 17, 2020 20:08
webserver.yml ansible
- hosts: webserver
vars_files:
- vars.yml
tasks:
- name: "Install HTTPD "
package:
name: "httpd"
state: present
register: httpd_install
#configure namenode
- name: "configure namenode"
hosts: hadoop_namenode
tags:
- "namenode"
vars:
user_dir: "{{ ansible_facts['user_dir'] }}"
vars_files:
- vars.yml
- namenode/vars.yml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>dfs.data.dir</name>
<value>{{user_dir}}{{datanode_directory }}</value>
</property>
</configuration>
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>fs.default.name</name>
<value>hdfs://{{ groups['hadoop_namenode'][0] }}:{{hadoop_port}}</value>
</property>
</configuration>
@ShubhamRasal
ShubhamRasal / namenode-hdfs-site.xml
Created December 17, 2020 06:44
namenode-hdfs-site.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>dfs.name.dir</name>
<value>{{user_dir}}{{namenode_directory }}</value>
</property>
</configuration>
@ShubhamRasal
ShubhamRasal / namenode-core-site.xml
Created December 17, 2020 06:42
namenode core-site.xml for ansible
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>fs.default.name</name>
<value>hdfs://{{ groups['hadoop_namenode'][0] }}:{{hadoop_port}}</value>
</property>
</configuration>
@ShubhamRasal
ShubhamRasal / hadoop-install.yml
Created December 17, 2020 06:26
ansible playbook to install hadoop
#Install hadoop on namenode and datanodes
- hosts:
- hadoop_namenode
- hadoop_datanode
vars:
- user_directory: "{{ ansible_facts['user_dir']}}"
tasks:
#copy java software
- name: "Transfer JDK 8"
@ShubhamRasal
ShubhamRasal / ssm send-command
Created December 6, 2020 11:12
ssm send-command
aws ssm send-command \
--document-name "AWS-RunShellScript" \
--parameters commands=["sudo yum install httpd git -y,
sudo systemctl start httpd,
sudo systemctl enable httpd,
sudo mkfs.ext4 /dev/xvdf/ /var/www/html ,
sudo rm -rf /var/www/html/*,
sudo git clone https://github.com/creatorsbyheart/creatorsbyheart.github.io.git /var/www/html/ ,
sudo systemctl restart httpd "]
--targets "Key=instanceids,Values=<instance-id>"
@ShubhamRasal
ShubhamRasal / cloudfront create-distribution
Created December 6, 2020 11:00
cloudfront create-distribution
aws cloudfront create-distribution --distribution-config file://cf_config.json
{
"CallerReference": "shubham-rasal",
"Aliases": {
"Quantity":0
},
"Origins": {
"Quantity": 1,
"Items": [
{
"Id": "cloudfront-dev-creatorsbyheart.com",