From fa1a35fe7c7b043471b18c768c5bd1fa971fe3bc Mon Sep 17 00:00:00 2001
From: rdecoupe <remy.decoupes@inrae.fr>
Date: Mon, 27 Jan 2020 12:06:58 +0100
Subject: [PATCH] geonetwork after install in debian10

---
 README.md                      | 20 +++++++++++++++++---
 vagrant/cluster/Vagrantfile    |  2 ++
 vagrant/geonetwork/Vagrantfile | 19 ++++++++++++-------
 3 files changed, 31 insertions(+), 10 deletions(-)

diff --git a/README.md b/README.md
index e5f2cf3..c7d0d41 100644
--- a/README.md
+++ b/README.md
@@ -9,6 +9,8 @@ Acutally, this project does :
 2. Deploy a cluster HDFS on :
 	* [Your own computer using as many virtual machine you want using Vagrant & ansible](#deploy-cluster-hdfs-with-multiple-vms)
 	* [multiple servers using ansible](#deploy-cluster-hdfs-on-servers)
+3. Deploy a geonetwork as metadata system management
+	* [Your own computer using a virtual machine with Vagrant & ansible provision]
 
 **Prod Environment** : Deploy a mononode HDFS on a server using ansible 
 **Sandbox Environment**: Deploy a mononode HDFS on a VM from Vagrant & Ansible
@@ -83,13 +85,13 @@ Then run the script [ansible-launch.sh](ansible-launch.sh) :
 # Deploy a HDFS cluster
 ## Deploy cluster HDFS with multiple VMs
 1. Set your nodes' IP address in [VagrantFile](vagrant/cluster/Vagrantfile).
-Inside this file, edit your network setting (name for your interface adaptator and DNS option)
-2. Declare those IP for ansible provision in [vars](playbook/roles/hosts-file/vars/main.yml)
+Inside this file, edit your network setting (as DNS nameserver: if your host machine is on a corporate network, your network administrator may have set rules about using DNS servers. In this case, your network allows only your company's DNS. Please edit them in the settings section *and* in provision shell in vagrantFile. If this is not the case (i.e. no DNS rules), please assign "false" to the COMPANY_NETWORK_DNS_RULE variable.
+2. Declare those IP for ansible provision in [vars](playbook/roles/hosts-file/vars/main.yml). If you did not change IP setting, skip this step.
 3. Configure your own computer to access to your nodes using their hostname (need for access to hadoop web ui)
 	```shell
 	vim /etc/hosts
 	```	
-	if you did not edit your cluster settings since you git have pulled, you may want to use this default settings:
+	if you did not edit your cluster settings since you have git pulled, you may want to use this default settings:
 	```shell
 	10.0.0.10 namenode
 	10.0.0.11 datanode1
@@ -121,6 +123,18 @@ Inside this file, edit your network setting (name for your interface adaptator a
 ## Deploy cluster HDFS on servers
 work in progress
 
+# Deploy GeoNetwork
+## With Vagrant and ansible
+1. Set your nodes' IP address in [VagrantFile](vagrant/geonetwork/Vagrantfile).
+Inside this file, edit your network setting (as DNS nameserver: if your host machine is on a corporate network, your network administrator may have set rules about using DNS servers. In this case, your network allows only your company's DNS. Please edit them in the settings section *and* in provision shell in vagrantFile. If this is not the case (i.e. no DNS rules), please assign "false" to the COMPANY_NETWORK_DNS_RULE variable.
+2. in cli : start a geonetwork vm form this directory : vagrant/geonetwork](vagrant/geonetwork) :
+	```shell
+	vagrant up
+	```
+3. On your own computer, using a webrowser, go on http://10.0.0.9:8080/geonetwork (if IP address as default)
+## On server
+work in progress
+
 ## License
 ![licence](https://img.shields.io/badge/Licence-GPL--3-blue.svg)
 
diff --git a/vagrant/cluster/Vagrantfile b/vagrant/cluster/Vagrantfile
index abdcf6d..842ed64 100644
--- a/vagrant/cluster/Vagrantfile
+++ b/vagrant/cluster/Vagrantfile
@@ -2,6 +2,8 @@
 NUMBER_OF_DATANODE = 2
 DEPLOY_Geonetwork = false
 ENTREPRISE_NETWORK_DNS_RULE = true
+DNS_server_1 = "172.16.1.1"
+DNS_server_2 = "172.16.1.2"
 ### end of Configuration parameters ###
 
 Vagrant.configure("2") do |config|
diff --git a/vagrant/geonetwork/Vagrantfile b/vagrant/geonetwork/Vagrantfile
index 376e3e9..a3a6af3 100644
--- a/vagrant/geonetwork/Vagrantfile
+++ b/vagrant/geonetwork/Vagrantfile
@@ -1,18 +1,23 @@
 # -*- mode: ruby -*-
 # vi: set ft=ruby :
+### Configuration parameters ###
+ENTREPRISE_NETWORK_DNS_RULE = true
+DNS_server_1 = "172.16.1.1"
+DNS_server_2 = "172.16.1.2"
+### end of Configuration parameters ###
 
 Vagrant.configure("2") do |config|
   config.vm.box = "generic/debian9"
 
   config.vm.define "aidmoit-geonetwork"
   config.vm.hostname = "aidmoit-geonetwork"
-  config.vm.network "public_network", bridge:"enp1s0", use_dhcp_assigned_default_route: true
-
-  config.vm.provision "shell", inline: <<-SHELL
-    systemctl stop resolvconf
-    echo "nameserver 10.34.192.61" >> /etc/resolv.conf
-    echo "nameserver 10.34.192.62" >> /etc/resolv.conf
-  SHELL
+  if ENTREPRISE_NETWORK_DNS_RULE == true
+    config.vm.provision "shell", inline: <<-SHELL
+      systemctl stop resolvconf
+      echo "nameserver 172.16.1.1" > /etc/resolv.conf
+      echo "nameserver 172.16.1.2" >> /etc/resolv.conf
+    SHELL
+  end
 
   config.vm.network :private_network, ip: "10.0.0.9"
 
-- 
GitLab