Skip to content

Commit

Permalink
- Removing Ansible install docs since it is not currently supported …
Browse files Browse the repository at this point in the history
…anymore
  • Loading branch information
afabiani committed May 17, 2020
1 parent 08298b0 commit 20b5926
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 229 deletions.
5 changes: 3 additions & 2 deletions basic/settings/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1977,7 +1977,7 @@ SOCIAL_ORIGINS
A list of dictionaries that are used to generate the social links displayed in the Share tab. For each origin, the name and URL format parameters are replaced by the actual values of the ResourceBase object (layer, map, document).

SOCIALACCOUNT_WITH_GEONODE_LOCAL_SINGUP
----
---------------------------------------

Default: ``True``

Expand All @@ -1993,7 +1993,8 @@ SRID
}

SEARCH_RESOURCES_EXTENDED
----
-------------------------

Default: ``True``

This will extend search with additinoal properties. By default its on and search engine will check resource title or purpose or abstract.
Expand Down
219 changes: 0 additions & 219 deletions install/project/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -286,222 +286,3 @@ Run the containers in daemon mode
docker-compose -f docker-compose.yml -f docker-compose.override.example-org.yml up --build -d
.. _install-with-ansible:

Ansible
=======
`Ansible <https://www.ansible.com/>`__ is an open-source software provisioning, configuration management, and application-deployment tool for IT infrastructure. It is written in `Python <https://www.python.org/>`_ and
allows users to manage `nodes` (computers) over SSH. Configuration files are written in `YAML <https://en.wikipedia.org/wiki/YAML>`_, a simple, human-readable, data serialization format.

Ansible can be used for automating the manual installation process of GeoNode. In case you're new to GeoNode we suggest first to get an Overview of :doc:`/install/core/index` components.


Installing Ansible
^^^^^^^^^^^^^^^^^^

Before you install `Ansible` make sure you have Python 2 (version 2.7) or Python 3 (versions 3.5 and higher)
on the controlling machine, you will also need an SSH client. Most Linux distributions
come with an SSH client preinstalled.

.. note:: For further installation instruction, please visit the `official installation documentation <http://docs.ansible.com/ansible/intro_installation.html>`_.


Test your Setup
^^^^^^^^^^^^^^^

After you've installed Ansible, you can test your setup by use of the following command

.. code::
ansible localhost -m ping
You should get the following output::

localhost | success >> {
"changed": false,
"ping": "pong"
}

Ansible Hosts file
^^^^^^^^^^^^^^^^^^

Ansible keeps information about the managed nodes in the `inventory` or `hosts file`.
Edit or create the hosts file with your favorite editor::

vim /etc/ansible/hosts

This file should contain a list of nodes for Ansible to manage. Nodes can be referred to
either with IP or hostname. The syntax is the following::

192.168.1.50
aserver.example.org
bserver.example.org

For targeting several servers you can group them like::

mail.example.com

[webservers]
foo.example.com
bar.example.com

[dbservers]
one.example.com
two.example.com
three.example.com

[geonode]
mygeonode.org

Public Key access
^^^^^^^^^^^^^^^^^

To avoid having to type your user's password to connect to the nodes over and over, using
SSH keys is recommended. To setup Public Key SSH access to the nodes. First, create a key pair::

ssh-keygen

And follow the instructions on the screen. A new key pair will be generated and
placed inside the `.ssh` folder in your user's home directory.

All you need to do now is copy the public key (id_rsa.pub) into the `authorized_keys`
file on the node you want to manage, inside the user's home directory. For example,
if you want to be able to connect to mygeonode.org as user `geo` edit the
/home/geo/.ssh/authorized_keys file on the remote machine and add the content
of your public key inside the file.

For more information on how to set up SSH keys in Ubuntu
refer to `this <https://help.ubuntu.com/community/SSH/OpenSSH/Keys>`_ document.

Connect to managed nodes
^^^^^^^^^^^^^^^^^^^^^^^^

Now that SSH access to the managed nodes is in place for all the nodes inside the Ansible
`inventory` (hosts file), we can run our first command::

ansible geonode -m ping -u geo

.. note::

change `geo` with the username to use for SSH login

The output will be similar to this::

ansible all -m ping -u geo
84.33.2.70 | success >> {
"changed": false,
"ping": "pong"
}

We asked Ansible to connect to the machine in our `Inventory` grouped under `[geonode] as user `geo`
and run the `module` ping (modules are Ansible's units of work).
As you can see by the output, Ansible successfully connected to the remote machine
and executed the module `ping`.

Ad hoc commands and playbooks
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Ansible integrates two basic concepts of running commands:
An ad-hoc command is something that you might type in to do something immediately,
but don’t want to save for later. One example of an ad-hoc command is the ping command we just ran. We typed in the
command line and ran it interactively.

For more information on ad-hoc command refer to the `adhoc documentation section <https://docs.ansible.com/ansible/intro_adhoc.html>`_.

Playbooks are Ansible’s configuration, deployment and orchestration language.
In contrast to ad hoc commands, Playbooks can declare configurations, but they can also orchestrate steps of any manual ordered process.

For more information on playbooks refer to the `playbook documentation section <https://docs.ansible.com/ansible/latest/user_guide/playbooks.html>`_.

In the following, we will provide you an example on how to setup a playbook for installing GeoNode on a server.


Installing GeoNode project by use of a playbook
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

First, we have to install the underlying steps for installing geonode provided by the official GeoNode role::

$ ansible-galaxy install geonode.geonode


.. note:: Roles are ways of automatically loading certain vars_files, tasks, and handlers based on a known file structure. Grouping content by roles also allows easy sharing of roles with other users.

See: https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_roles.html

To find out how these install tasks are defined, we suggest having a look a the `different tasks <https://github.com/GeoNode/ansible-geonode/tree/master/tasks>`_ of role geonode.

Setup a playbook
^^^^^^^^^^^^^^^^

After installation of the role geonode.geonode we will now create a simple playbook which defines what should happen.
Create the playbook file where it suits best for you. For example in your home folder::

mkdir ~/geonode_ansible
vim ~/geonode_ansible/install_geonode.yml

with following content

.. code-block:: shell
---
- name: Provision a GeoNode into Production
hosts: geonode
remote_user: geo
vars:
app_name: my_geonode
server_name: 84.33.2.70
deploy_user: ubuntu
code_repository: https://github.com/GeoNode/geonode-project.git
branch_name: master
virtualenv_dir: /home/geo/.venvs
site_url: http://mygeonode.org/
geoserver_url: https://build.geo-solutions.it/geonode/geoserver/latest/geoserver-2.16.2.war
pg_max_connections: 100
pg_shared_buffers: 128MB
tomcat_xms: 1024M
tomcat_xmx: 2048M
nginx_client_max_body_size: 400M
gather_facts: False
pre_tasks:
- name: Install python for Ansible
become: yes
become_user: root
raw: test -e /usr/bin/python || (apt -y update && apt install -y python3-minimal)
roles:
- { role: GeoNode.geonode }
The playbook is composed of different parts. The most important are:
The **hosts part** specifies to which hosts in the Inventory this playbook applies and
how to connect to them. This points to your hosts file with grouped servers under `[geonode]` as
explained before. (Most likely you will only have one node under group geonode)
The **vars** section mainly describe configured settings. Please visit the geonode ansible readme regarding `role variables <https://github.com/GeoNode/ansible-geonode#role-variables>`_.
**Roles** points to our installed geonode role which has all needed installation tasks.
Run the Playbook
^^^^^^^^^^^^^^^^
Now that we have created our Playbook, we can execute it with::
ansible-playbook ~/geonode_ansible/install_geonode.yml -u geo
PLAY [84.33.2.70] *************************************************************
GATHERING FACTS ***************************************************************
ok: [84.33.2.70]
...
Ansible should connect to the host specified in the hosts section grouped by `[geonode]` and run the install tasks one by one. If something goes wrong Ansible will fail fast and stop the installation process.
When successfully finished you should be able to see GeoNode's welcome screen at your `site_url`.
This concludes our brief tutorial on Ansible. For a more thorough introduction
refer to the `official documentation <https://docs.ansible.com/>`_.
Also, take a look at the `Ansible examples repository <https://github.com/ansible/ansible-examples>`_
or a set of Playbooks showing common techniques.
8 changes: 0 additions & 8 deletions start/quick/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,6 @@ To try out the applications, simply:
`OSGeoLive <http://live.osgeo.org/>`_ is an `OSGeo Foundation <http://osgeo.org/>`_ project.
The `OSGeo Foundation <http://osgeo.org/>`_ is a not-for-profit supporting Geospatial Open Source Software development, promotion and `education <http://www.geoforall.org/>`_.

Install via Ansible
^^^^^^^^^^^^^^^^^^^

`Ansible <https://www.ansible.com/>`__ is an open source automation tool for server configuration and management. It works by organizing your server inventory into groups, describes how those groups should be configured or what actions should be taken on them. We can use ansible for installing GeoNode-project on one or many servers.

* :ref:`Manual installation of geonode-project <install-with-ansible>` by use of Ansible


Install via Docker
^^^^^^^^^^^^^^^^^^

Expand Down

0 comments on commit 20b5926

Please sign in to comment.