How Build a Lizmap Virtual Machine

How Build a Lizmap Virtual Machine

Starting from “GitHub-Lizmap” and after having installed “VirtualBox”  and “Vagrant

Go to https://github.com/3liz/lizmap-web-client/tree/master/vagrant

and copy the following files:

* Vagrantfile
* hosts
* playbook.yml

Pay attention at the files extension and at content of the files!!!

Don’use “save link as…” because browser could create “HTML” files…

 

Go to Vagrand folder (C:\HashiCorp\Vagrant\ or other path containing Your Vagrand) and create two folder:
* roles
* vars

In these folders, following the structure displayed at https://github.com/3liz/lizmap-web-client/tree/master/vagrant, create subfolders and files.

After created folders and files…

Go to DOS (Run as “administrator”), search for the Vagrand folder (C:\HashiCorp\Vagrant\ or other path containing Your Vagrand).

Change DIR to Vagrand.

Type “vagrant up” (without quotes) and press return.

This is a log of the operations that will be performed by setting up.

Have (Q)GIS Fun!

**********************************************************************************
C:\>cd HashiCorp

C:\HashiCorp>cd Vagrant

C:\HashiCorp\Vagrant>vagrant up
Bringing machine ‘default’ up with ‘virtualbox’ provider…
==> default: Box ‘debian/contrib-stretch64’ could not be found. Attempting to find and install…
default: Box Provider: virtualbox
default: Box Version: >= 0
==> default: Loading metadata for box ‘debian/contrib-stretch64’
default: URL: https://vagrantcloud.com/debian/contrib-stretch64
==> default: Adding box ‘debian/contrib-stretch64’ (v9.4.0) for provider: virtualbox
default: Downloading: https://vagrantcloud.com/debian/boxes/contrib-stretch64/versions/9.4.0/providers/virtualbox.box
default:
==> default: Successfully added box ‘debian/contrib-stretch64’ (v9.4.0) for ‘virtualbox’!
==> default: Importing base box ‘debian/contrib-stretch64’…
==> default: Matching MAC address for NAT networking…
==> default: Checking if box ‘debian/contrib-stretch64’ is up to date…
==> default: Setting the name of the VM: lizmap_3_0
Vagrant is currently configured to create VirtualBox synced folders with
the `SharedFoldersEnableSymlinksCreate` option enabled. If the Vagrant
guest is not trusted, you may want to disable this option. For more
information on this option, please refer to the VirtualBox manual:

https://www.virtualbox.org/manual/ch04.html#sharedfolders

This option can be disabled globally with an environment variable:

VAGRANT_DISABLE_VBOXSYMLINKCREATE=1

or on a per folder basis within the Vagrantfile:

config.vm.synced_folder ‘/host/path’, ‘/guest/path’, SharedFoldersEnableSymlinksCreate: false
==> default: Clearing any previously set network interfaces…
==> default: Preparing network interfaces based on configuration…
default: Adapter 1: nat
==> default: Forwarding ports…
default: 80 (guest) => 8130 (host) (adapter 1)
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running ‘pre-boot’ VM customizations…
==> default: Booting VM…
==> default: Waiting for machine to boot. This may take a few minutes…
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
default:
default: Vagrant insecure key detected. Vagrant will automatically replace
default: this with a newly generated keypair for better security.
default:
default: Inserting generated public key within guest…
default: Removing insecure key from the guest if it’s present…
default: Key inserted! Disconnecting and reconnecting using new SSH key…
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM…
default: The guest additions on this VM do not match the installed version of
default: VirtualBox! In most cases this is fine, but in rare cases it can
default: prevent things such as shared folders from working properly. If you see
default: shared folder errors, please make sure the guest additions within the
default: virtual machine match the version of VirtualBox you have installed on
default: your host and reload your VM.
default:
default: Guest Additions Version: 5.1.30_Debian r118389
default: VirtualBox Version: 5.2
==> default: Mounting shared folders…
default: /vagrant => C:/HashiCorp/Vagrant
default: /lizmap_web_client => C:/HashiCorp
==> default: Running provisioner: ansible_local…
default: Installing Ansible…
Vagrant has automatically selected the compatibility mode ‘2.0’
according to the Ansible version installed (2.2.1.0).

Alternatively, the compatibility mode can be specified in your Vagrantfile:
https://www.vagrantup.com/docs/provisioning/ansible_common.html#compatibility_mode
default: Running ansible-playbook…

PLAY [all] *********************************************************************

TASK [setup] *******************************************************************
ok: [default]

TASK [common : apt] ************************************************************
ok: [default]

TASK [common : Local – Configure the timezone] *********************************
changed: [default]

TASK [common : Local – More Configure the timezone] ****************************
changed: [default]

TASK [common : Local – Set default system language pack] ***********************
changed: [default]

TASK [common : Local – Set default system language pack – export LANG and LC_ALL] ***
changed: [default]

TASK [common : Local – Ensure LANG is set system-wide in /etc/profile.d/ for PostgreSQL 2/2] ***
changed: [default]

TASK [common : Install some packages] ******************************************
changed: [default] => (item=[u’apt-transport-https’, u’nano’, u’vim’, u’htop’, u’sudo’, u’git’, u’acl’])

TASK [common : Remove apache – Debian] *****************************************
ok: [default]

TASK [common : Install Nginx Debian] *******************************************
changed: [default]

TASK [common : Add directories for virtual hosts] ******************************
ok: [default] => (item=/etc/nginx)
ok: [default] => (item=/etc/nginx/sites-enabled)
ok: [default] => (item=/etc/nginx/sites-available)

TASK [common : Enable gzip compression] ****************************************
changed: [default]

TASK [common : Ensure that nginx is running] ***********************************
ok: [default]

TASK [common : Install Supervisord] ********************************************
changed: [default]

TASK [common : copy] ***********************************************************
changed: [default]

TASK [common : Override Supervisord config file] *******************************
changed: [default]

TASK [common : file] ***********************************************************
ok: [default]

TASK [common : Ensure that supervisor service is running] **********************
ok: [default]

TASK [common : xvfb – install package] *****************************************
changed: [default]

TASK [common : Check if server uses systemd or init] ***************************
changed: [default]

TASK [common : xvfb – create service file – systemd] ***************************
changed: [default]

TASK [common : xvfb – create service file – init] ******************************
skipping: [default]

TASK [common : xvfb – ensure that service is running] **************************
changed: [default]

TASK [common : Create system user lizmap] **************************************
changed: [default]

TASK [qgis : Add log directory] ************************************************
changed: [default]

TASK [qgis : Set Server logrotate] *********************************************
changed: [default]

TASK [qgis : Add supervisor config] ********************************************
changed: [default]

TASK [qgis : Copy QGIS local package] ******************************************
skipping: [default]

TASK [qgis : Install QGIS – Debian] ********************************************
skipping: [default]

TASK [qgis : Add QGIS repository key – 1] **************************************
changed: [default]
[WARNING]: Consider using get_url or uri module rather than running wget

TASK [qgis : Add QGIS repository key – 2] **************************************
changed: [default]

TASK [qgis : Add QGIS repository key – 3] **************************************
changed: [default]

TASK [qgis : Add QGIS repository] **********************************************
changed: [default]

TASK [qgis : Install QGIS from repository – Debian] ****************************
changed: [default] => (item=[u’qgis-server’])

TASK [qgis : Add QGIS config directory] ****************************************
changed: [default]

TASK [qgis : Add QGIS config file] *********************************************
changed: [default]

TASK [qgis : Create QGIS server nginx configuration] ***************************
changed: [default]

TASK [qgis : Activate QGIS server nginx configuration] *************************
changed: [default]

TASK [qgis : Install python-qgis for Debian] ***********************************
changed: [default] => (item=[u’python-qgis’])

TASK [qgis : Add QGIS plugins directory] ***************************************
changed: [default]

TASK [qgis : Install QGIS server plugins from github] **************************
changed: [default] => (item={‘key’: u’wfsOutputExtension’, ‘value’: {u’version’: u’master’, u’repository’: u’https://github.com/3liz/qgis-wfsOutputExtension’}})

TASK [qgis : Restart Supervisor Debian] ****************************************
changed: [default]

TASK [postgresql : Import repository key – Debian] *****************************
changed: [default]

TASK [postgresql : Add official repository – Debian] ***************************
changed: [default]

TASK [postgresql : PostgreSQL – Update apt – Debian] ***************************
changed: [default]

TASK [postgresql : PostgreSQL – install packages – Debian] *********************
changed: [default] => (item=[u’postgresql-9.6′, u’postgresql-client-9.6′, u’postgresql-contrib-9.6′, u’python-pygresql’, u’python-psycopg2′, u’postgresql-9.6-postgis-2.3′])

TASK [postgresql : Check if database already exists] ***************************
changed: [default]

TASK [postgresql : Drop and recreate cluster to ensure locale – Debian] ********
changed: [default] => (item=pg_dropcluster –stop 9.6 main)
changed: [default] => (item=pg_createcluster –start –locale fr_FR.UTF-8 9.6 main)

TASK [postgresql : Change postgres user password] ******************************
changed: [default]

TASK [postgresql : PostgreSQL – create database] *******************************
changed: [default]

TASK [postgresql : PostgreSQL – enable postgis extension] **********************
changed: [default]

TASK [postgresql : PostgreSQL – create user] ***********************************
changed: [default]

TASK [postgresql : PostgreSQL – apply user privileges on database] *************
ok: [default]

TASK [postgresql : PostgreSQL – listen on all adresses] ************************
changed: [default]

TASK [postgresql : PostgreSQL – allow access to host for the database user] ****
changed: [default]

TASK [lizmap : Import PHP repository key] **************************************
changed: [default]

TASK [lizmap : Add PHP repository] *********************************************
changed: [default]

TASK [lizmap : PHP – Update apt] ***********************************************
changed: [default]

TASK [lizmap : Install PHP] ****************************************************
changed: [default] => (item=[u’php5.6-fpm’, u’php5.6-curl’, u’php5.6-cli’, u’php5.6-sqlite3′, u’php5.6-pgsql’, u’php5.6-gd’, u’php5.6-intl’, u’php5.6-xml’, u’php-redis’])

TASK [lizmap : setup user into php fpm pool] ***********************************
changed: [default]

TASK [lizmap : setup group into php fpm pool] **********************************
changed: [default]

TASK [lizmap : Add temp directory] *********************************************
changed: [default]

TASK [lizmap : Set rights on dirs] *********************************************
fatal: [default]: FAILED! => {“changed”: true, “cmd”: “cd /lizmap_web_client && lizmap/install/set_rights.sh vagrant vagrant”, “delta”: “0:00:00.002600”, “end”: “2018-05-02 12:06:43.967502”, “failed”: true, “rc”: 127, “start”: “2018-05-02 12:06:43.964902”, “stderr”: “/bin/sh: 1: lizmap/install/set_rights.sh: not found”, “stdout”: “”, “stdout_lines”: [], “warnings”: []}

RUNNING HANDLER [common : restart supervisor] **********************************

RUNNING HANDLER [common : restart nginx] ***************************************

RUNNING HANDLER [postgresql : restart postgresql] ******************************

RUNNING HANDLER [lizmap : restart php-fpm] *************************************
to retry, use: –limit @/vagrant/playbook.retry

PLAY RECAP *********************************************************************
default : ok=59 changed=51 unreachable=0 failed=1

Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.

C:\HashiCorp\Vagrant>

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.


%d bloggers like this: