Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
okeanos-LoD
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
itminedu
okeanos-LoD
Commits
822737ea
Commit
822737ea
authored
Jul 09, 2015
by
Georgios Ouzounis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LAM-33 Created common role.
parent
3d1b6300
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
68 additions
and
92 deletions
+68
-92
ansible/playbooks/common/install.yml
ansible/playbooks/common/install.yml
+6
-0
ansible/playbooks/install.yml
ansible/playbooks/install.yml
+0
-31
ansible/roles/common/files/environment
ansible/roles/common/files/environment
+2
-0
ansible/roles/common/files/environment.backup
ansible/roles/common/files/environment.backup
+0
-0
ansible/roles/common/files/ssh-config
ansible/roles/common/files/ssh-config
+12
-0
ansible/roles/common/tasks/common-1.yml
ansible/roles/common/tasks/common-1.yml
+18
-0
ansible/roles/common/tasks/common-2.yml
ansible/roles/common/tasks/common-2.yml
+3
-2
ansible/roles/common/tasks/main.yml
ansible/roles/common/tasks/main.yml
+17
-0
ansible/roles/common/tasks/master.yml
ansible/roles/common/tasks/master.yml
+7
-0
ansible/roles/common/templates/hosts.j2
ansible/roles/common/templates/hosts.j2
+3
-3
ansible/tasks/aptitude/java.yml
ansible/tasks/aptitude/java.yml
+0
-5
ansible/tasks/aptitude/python.yml
ansible/tasks/aptitude/python.yml
+0
-5
ansible/tasks/aptitude/upgrade.yml
ansible/tasks/aptitude/upgrade.yml
+0
-6
ansible/tasks/aptitude/vim.yml
ansible/tasks/aptitude/vim.yml
+0
-5
ansible/tasks/hadoop/hdfs_dirs.yml
ansible/tasks/hadoop/hdfs_dirs.yml
+0
-7
ansible/tasks/install/environment.yml
ansible/tasks/install/environment.yml
+0
-8
ansible/tasks/install/hosts.yml
ansible/tasks/install/hosts.yml
+0
-8
ansible/tasks/ssh/fetch-key.yml
ansible/tasks/ssh/fetch-key.yml
+0
-4
ansible/tasks/ssh/ssh-keygen.yml
ansible/tasks/ssh/ssh-keygen.yml
+0
-8
No files found.
ansible/playbooks/common/install.yml
0 → 100644
View file @
822737ea
---
-
hosts
:
all
user
:
root
roles
:
-
../roles/common
ansible/playbooks/install.yml
deleted
100644 → 0
View file @
3d1b6300
---
-
hosts
:
vms
user
:
root
tasks
:
# aptitude packages
-
include
:
../tasks/aptitude/upgrade.yml tags=install_scripts
-
include
:
../tasks/aptitude/java.yml tags=install_scripts
-
include
:
../tasks/aptitude/vim.yml tags=install_scripts
-
include
:
../tasks/aptitude/python.yml tags=install_scripts
# copy /etc/hosts file
-
include
:
../tasks/install/hosts.yml tags=install_scripts
# copy /etc/environment file
-
include
:
../tasks/install/environment.yml tags=install_scripts
# run ssh-keygen
-
include
:
../tasks/ssh/ssh-keygen.yml tags=install_scripts
-
hosts
:
master
user
:
root
tasks
:
# copy ssh public key of master
-
include
:
../tasks/ssh/fetch-key.yml
-
hosts
:
vms
user
:
root
tasks
:
# distribute ssh key to all nodes
-
include
:
../tasks/ssh/authorized-key.yml
ansible/roles/common/files/environment
0 → 100644
View file @
822737ea
export JAVA_HOME=/usr/
export HADOOP_HOME=/usr/local/hadoop
ansible/
files/etc/environment
→
ansible/
roles/common/files/environment.backup
View file @
822737ea
File moved
ansible/roles/common/files/ssh-config
0 → 100644
View file @
822737ea
Host master-node
StrictHostKeyChecking no
Host slave-1
StrictHostKeyChecking no
Host slave-2
StrictHostKeyChecking no
Host 0.0.0.0
StrictHostKeyChecking no
ansible/roles/common/tasks/common-1.yml
0 → 100644
View file @
822737ea
---
-
name
:
Upgrade packages.
apt
:
upgrade=dist update_cache=yes
-
name
:
Install the latest Java 7.
apt
:
name=openjdk-7-jdk state=latest install_recommends=no update_cache=yes
-
name
:
Copy hosts file.
template
:
src=hosts.j2 dest=/etc/hosts backup=no owner=root group=root mode=0750
-
name
:
Copy environment file.
copy
:
src=environment dest=/etc/environment backup=no owner=root group=root mode=0750
-
name
:
Generate ssh key.
shell
:
cat /dev/zero | ssh-keygen -q -N ""
args
:
creates
:
/root/.ssh/id_rsa.pub
ansible/
tasks/ssh/authorized-key
.yml
→
ansible/
roles/common/tasks/common-2
.yml
View file @
822737ea
---
-
name
:
ssh key
authorized_key
:
user=root key="{{ lookup('file', '/tmp/fetched/id_rsa.pub') }}"
-
name
:
Distribute ssh key to all nodes.
authorized_key
:
user=root key="{{ lookup('file', '/tmp/fetched/id_rsa.pub') }}"
ansible/roles/common/tasks/main.yml
0 → 100644
View file @
822737ea
---
-
name
:
Include common tasks.
include
:
common-1.yml
tags
:
-
common-1
-
name
:
Include tasks for master.
include
:
master.yml
when
:
"
'master'
in
group_names"
tags
:
-
master
-
name
:
Include more common tasks.
include
:
common-2.yml
tags
:
-
common-2
ansible/roles/common/tasks/master.yml
0 → 100644
View file @
822737ea
---
-
name
:
Fetch id_rsa.pub file from master.
fetch
:
src=/root/.ssh/id_rsa.pub dest=/tmp/fetched/ flat=yes
-
name
:
Set up ssh config.
copy
:
src="ssh-config" dest="/root/.ssh/config" owner=root group=root mode=664
ansible/
files/etc/hosts
→
ansible/
roles/common/templates/hosts.j2
View file @
822737ea
127.0.0.1 localhost
192.168.0.3 snf-661306
192.168.0.2 snf-661303
192.168.0.4 snf-661304
{{ hostvars["master-node"]["internal_ip"] }} master-node
{{ hostvars["slave-1"]["internal_ip"] }} slave-1
{{ hostvars["slave-2"]["internal_ip"] }} slave-2
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
...
...
ansible/tasks/aptitude/java.yml
deleted
100644 → 0
View file @
3d1b6300
---
# Install latest version of "openjdk-7-jdk" ignoring "install-recommends"
-
name
:
install latest Java
7
tags
:
install_scripts
apt
:
name=openjdk-7-jdk state=latest install_recommends=no update_cache=yes
ansible/tasks/aptitude/python.yml
deleted
100644 → 0
View file @
3d1b6300
---
# Install python
-
name
:
install python
tags
:
install_scripts
apt
:
name=python state=latest install_recommends=no update_cache=yes
ansible/tasks/aptitude/upgrade.yml
deleted
100644 → 0
View file @
3d1b6300
---
# Update all packages to the latest version
-
name
:
Upgrade packages
tags
:
install_scripts
apt
:
upgrade=dist update_cache=yes
ansible/tasks/aptitude/vim.yml
deleted
100644 → 0
View file @
3d1b6300
---
# Install vim
-
name
:
install vim
tags
:
install_scripts
apt
:
name=vim state=latest install_recommends=no update_cache=yes
ansible/tasks/hadoop/hdfs_dirs.yml
deleted
100644 → 0
View file @
3d1b6300
---
-
name
:
Make hdfs user dir
command
:
/usr/local/hadoop/bin/hadoop fs -mkdir /user
-
name
:
Make hdfs user/root dir
command
:
/usr/local/hadoop/bin/hadoop fs -mkdir /user/root
ansible/tasks/install/environment.yml
deleted
100644 → 0
View file @
3d1b6300
---
#copy environment file
-
name
:
Copy environment file
tags
:
install_scripts
copy
:
src=../files/etc/environment
dest=/etc/ backup=no
owner=root group=root mode=0750
ansible/tasks/install/hosts.yml
deleted
100644 → 0
View file @
3d1b6300
---
#copy hosts ip-hostname file
-
name
:
Copy hosts file
tags
:
install_scripts
copy
:
src=../files/etc/hosts
dest=/etc/ backup=no
owner=root group=root mode=0750
ansible/tasks/ssh/fetch-key.yml
deleted
100644 → 0
View file @
3d1b6300
---
-
name
:
fetch id_rsa.pub file from master
fetch
:
src=/root/.ssh/id_rsa.pub dest=/tmp/fetched/ flat=yes
ansible/tasks/ssh/ssh-keygen.yml
deleted
100644 → 0
View file @
3d1b6300
---
-
name
:
Run ssh-keygen
tags
:
install_scripts
shell
:
cat /dev/zero | ssh-keygen -q -N ""
args
:
creates
:
/root/.ssh/id_rsa.pub
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment