diff options
author | Aaron Smith <aasmith@redhat.com> | 2018-10-05 11:46:31 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2018-10-05 11:46:31 +0000 |
commit | 28bfd38af164d1b7983c57a0683636bc9a0781fc (patch) | |
tree | e4d5c78e2366b78ec84a6dfa03fbe0d6b500b10a | |
parent | ada3bb5cda036c736b460b76552ce47dd8f40aa8 (diff) | |
parent | ba987198cd381a10b5075eac599fee9d2f6219d9 (diff) |
Merge "Add role to auto install docker on hosts - missing patch"
-rw-r--r-- | docker/ansible/roles/config_files/tasks/mcelog.yml | 2 | ||||
-rw-r--r-- | docker/ansible/roles/config_files/vars/main.yml | 5 | ||||
-rw-r--r-- | docker/ansible/roles/run_grafana/vars/main.yml | 4 | ||||
-rw-r--r-- | docs/release/userguide/docker.userguide.rst | 53 |
4 files changed, 50 insertions, 14 deletions
diff --git a/docker/ansible/roles/config_files/tasks/mcelog.yml b/docker/ansible/roles/config_files/tasks/mcelog.yml index bab4b142..794db98c 100644 --- a/docker/ansible/roles/config_files/tasks/mcelog.yml +++ b/docker/ansible/roles/config_files/tasks/mcelog.yml @@ -17,6 +17,7 @@ package: name: mcelog state: present + ignore_errors: "true" when: install_mcelog|default(false)|bool tags: - mcelogs @@ -26,6 +27,7 @@ name: mcelog state: started enabled: true + ignore_errors: "true" when: install_mcelog|default(false)|bool tags: - mcelogs diff --git a/docker/ansible/roles/config_files/vars/main.yml b/docker/ansible/roles/config_files/vars/main.yml index 461bfc3f..cbe64b3c 100644 --- a/docker/ansible/roles/config_files/vars/main.yml +++ b/docker/ansible/roles/config_files/vars/main.yml @@ -23,7 +23,10 @@ interval_value: 10 #network plugin vars network_port: 25826 -network_ip_addr: "{{ (groups['influxdb_hosts']|default({}))[0] | default('localhost') }}" +#get influxdb name as defined in inventory +influxdb_hostname: "{{ (groups['influxdb_hosts']|default({}))[0] | default('localhost') }}" +#get hostname as used by ansible +network_ip_addr: "{{ hostvars[influxdb_hostname].ansible_hostname }}" #prometheus plugin vars prometheus_port: 9103 diff --git a/docker/ansible/roles/run_grafana/vars/main.yml b/docker/ansible/roles/run_grafana/vars/main.yml index 5caf45da..0975b598 100644 --- a/docker/ansible/roles/run_grafana/vars/main.yml +++ b/docker/ansible/roles/run_grafana/vars/main.yml @@ -13,5 +13,5 @@ # limitations under the License. --- -influxdb_hostname: influxdb_host -influxdb_host_ip: "{{ (groups['influxdb_hosts']|default({}))[0] | default('localhost') }}" +influxdb_hostname: localhost +influxdb_host_ip: 127.0.0.1 diff --git a/docs/release/userguide/docker.userguide.rst b/docs/release/userguide/docker.userguide.rst index 7582e67b..79f2db1c 100644 --- a/docs/release/userguide/docker.userguide.rst +++ b/docs/release/userguide/docker.userguide.rst @@ -94,8 +94,8 @@ Kafka recieves and stores metrics recieved from Collectd. VES application pulls which it normalizes into VES format for sending to a VES collector. Please see details in :ref:`VES Application User Guide <barometer-ves-userguide>` -Download and Run Docker Images with Ansible-Playbook ----------------------------------------------------- +One Click Install with Ansible +------------------------------ Install Ansible ^^^^^^^^^^^^^^^ @@ -103,6 +103,7 @@ Install Ansible * sudo permissions or root access are required to install ansible. * ansible version needs to be 2.4+, because usage of import/include statements +The following steps have been verified with Ansible 2.6.3 on Ubuntu 16.04 and 18.04. To install Ansible 2.6.3 on Ubuntu: .. code:: bash @@ -111,6 +112,7 @@ To install Ansible 2.6.3 on Ubuntu: $ sudo apt-get install python-pip $ sudo pip install 'ansible==2.6.3' +The following steps have been verified with Ansible 2.6.3 on Centos 7.5. To install Ansible 2.6.3 on Centos: .. code:: bash @@ -130,7 +132,7 @@ Clone barometer repo Edit inventory file ^^^^^^^^^^^^^^^^^^^ -Edit inventory file and add hosts: ~/default.inv +Edit inventory file and add hosts: $barometer_dir/docker/ansible/default.inv .. code:: bash @@ -177,6 +179,12 @@ and insert_ipmi_modules, both variables are independent: install_mcelog=false insert_ipmi_modules=false +.. note:: + On Ubuntu 18.04 to use mcelog plugin the user has to install mcelog daemon + manually ahead of installing from ansible scripts as the deb package is not + available in official Ubuntu 18.04 repo. It means that setting install_mcelog + to true is ignored. + Configure ssh keys ^^^^^^^^^^^^^^^^^^ @@ -186,18 +194,34 @@ Generate ssh keys if not present, otherwise move onto next step. $ sudo ssh-keygen -Coppy ssh key to all target hosts. It requires to provide root password. The example is for localhost. +Copy ssh key to all target hosts. It requires to provide root password. +The example is for localhost. .. code:: bash $ sudo ssh-copy-id root@localhost -Download collectd+influxdb+grafana containers -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Verify that key is added and password is not required to connect. + +.. code:: bash + + $ sudo ssh root@localhost + +.. note:: + Keys should be added to every target host and [localhost] is only used as an + example. For multinode installation keys need to be copied for each node: + [collectd_hostname], [influxdb_hostname] etc. + +Download and run Collectd+Influxdb+Grafana containers +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The One Click installation features easy and scalable deployment of Collectd, +Influxdb and Grafana containers using Ansible playbook. The following steps goes +through more details. .. code:: bash - $ sudo ansible-playbook -i ~/default.inv collectd_service.yml + $ sudo ansible-playbook -i default.inv collectd_service.yml Check the three containers are running, the output of docker ps should be similar to: @@ -215,7 +239,9 @@ To make some changes when a container is running run: $ sudo docker exec -ti <CONTAINER ID> /bin/bash -Connect to <host_ip>:3000 with a browser and log into grafana: admin/admin +Connect to <host_ip>:3000 with a browser and log into Grafana: admin/admin. +For short introduction please see the: +`Grafana guide <http://docs.grafana.org/guides/getting_started/>`_. The collectd configuration files can be accessed directly on target system in '/opt/collectd/etc/collectd.conf.d'. It can be used for manual changes or enable/disable plugins. If configuration has been modified it is required to @@ -233,7 +259,7 @@ The 'zookeeper_hostname' and 'broker_id' can be set in ./roles/run_kafka/vars/ma .. code:: bash - $ sudo ansible-playbook -i ~/default.inv collectd_ves.yml + $ sudo ansible-playbook -i default.inv collectd_ves.yml Check the three containers are running, the output of docker ps should be similar to: @@ -273,13 +299,13 @@ To run a specific parts only: .. code:: bash - $ sudo ansible-playbook -i ~/default.inv collectd_service.yml --tags "syslog,cpu,uuid" + $ sudo ansible-playbook -i default.inv collectd_service.yml --tags "syslog,cpu,uuid" To disable some parts or plugins: .. code:: bash - $ sudo ansible-playbook -i ~/default.inv collectd_service.yml --skip-tags "en_default_all,syslog,cpu,uuid" + $ sudo ansible-playbook -i default.inv collectd_service.yml --skip-tags "en_default_all,syslog,cpu,uuid" List of available tags: @@ -311,6 +337,11 @@ Installing Docker .. Describe the specific capabilities and usage for <XYZ> feature. .. Provide enough information that a user will be able to operate the feature on a deployed scenario. +.. note:: + The below sections provide steps for manual installation and configuration + of docker images. They are not neccessary if docker images were installed with + use of Ansible-Playbook. + On Ubuntu ^^^^^^^^^^ .. note:: |