Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated installer #14

Open
mglantz opened this issue Feb 28, 2019 · 7 comments
Open

Automated installer #14

mglantz opened this issue Feb 28, 2019 · 7 comments

Comments

@mglantz
Copy link

mglantz commented Feb 28, 2019

Hi all,

I noticed that there were a lot of issues in the installers instructions. For example, missing instructions regarding database user, database name, issues in the db.sql dump. Instead of correcting them, I thought I'd try to re-make the installation experience by automating it in Ansible for Linux at least.

At the end, I'll end up with a simple yaml file alá
setting: value-x
setting2: value-y

I'm pretty far gone atm and hope to be done in the coming week or sooner. Please note that this makes the installer omnipotent as well, meaning you can re-run it without problems. Also, this fixes that db.sql contains statement for setting the root user password and allows the user to encrypt database / hi-ce user passwords using an Ansible vault.

Anyways. This turns the complete installations into editing the yaml settings file and running three commands:

[root@ip-172-31-24-100 ansible-installer]# yum -y install python-pip && pip install ansible
[root@ip-172-31-24-100 ansible-installer]# vi vars/settings.yml
[root@ip-172-31-24-100 ansible-installer]# ansible-playbook -i hosts install_helical.yml

PLAY [localhost] *****************************************************************************************************************************************

TASK [Enable EPEL] ***************************************************************************************************************************************
ok: [localhost]

TASK [Register to RHN and auto-subscribe to available content.] ******************************************************************************************
ok: [localhost]

TASK [Enable RHSM repositories (extras, optional)] *******************************************************************************************************
ok: [localhost] => (item=rhel-7-server-extras-rpms)
ok: [localhost] => (item=rhel-7-server-optional-rpms)

TASK [Install prerequisites] *****************************************************************************************************************************
[WARNING]: Consider using the yum module rather than running 'yum'. If you need to use command because yum is insufficient you can add 'warn: false' to
this command task or set 'command_warnings=False' in ansible.cfg to get rid of this message.

changed: [localhost]

TASK [Enable MariaDB service] ****************************************************************************************************************************
ok: [localhost]

TASK [Create the Helical database user] ******************************************************************************************************************
ok: [localhost]

TASK [Import sample report to Helical database] **********************************************************************************************************
changed: [localhost]

TASK [Set hi-repository path] ****************************************************************************************************************************
ok: [localhost]

TASK [Set BaseURL to listen to] **************************************************************************************************************************
ok: [localhost]

TASK [Configure app with correct helical database user] **************************************************************************************************
ok: [localhost]

TASK [Configure app with correct helical database password] **********************************************************************************************
ok: [localhost]

TASK [Configure app with correct helical database source] ************************************************************************************************
ok: [localhost]

TASK [Deploy hi-ce war file] *****************************************************************************************************************************
changed: [localhost]

TASK [Restart tomcat] ************************************************************************************************************************************
changed: [localhost]

TASK [Print BaseURL] *************************************************************************************************************************************
ok: [localhost] => {
"msg": "Helical Insights will be reachable at: http://35.157.136.233:8080/hi-ce/hi.html"
}

PLAY RECAP ***********************************************************************************************************************************************
localhost : ok=15 changed=4 unreachable=0 failed=0

@mglantz
Copy link
Author

mglantz commented Feb 28, 2019

Feel free to check out progress in my fork at https://github.com/mglantz/helicalinsight

@mglantz
Copy link
Author

mglantz commented Feb 28, 2019

I'd say I'm in alpha now atleast :-)

# sudo yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm && sudo yum -y install python-pip git && sudo pip install ansible
# git clone https://github.com/mglantz/helicalinsight
# cd helicalinsight/ansible-installer && cp /tmp/vars.yml vars/vars.yml
# ansible-playbook install_helical.yml 
 [WARNING]: Unable to parse /etc/ansible/hosts as an inventory source

 [WARNING]: No inventory was parsed, only implicit localhost is available

 [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'


PLAY [localhost] *****************************************************************************************************************************************

TASK [Enable EPEL] ***************************************************************************************************************************************
ok: [localhost]

TASK [Register to RHN and auto-subscribe to available content.] ******************************************************************************************
ok: [localhost]

TASK [Enable RHSM repositories (extras, optional)] *******************************************************************************************************
ok: [localhost] => (item=rhel-7-server-extras-rpms)
ok: [localhost] => (item=rhel-7-server-optional-rpms)

TASK [Install prerequisites] *****************************************************************************************************************************
 [WARNING]: Consider using the yum module rather than running 'yum'.  If you need to use command because yum is insufficient you can add 'warn: false' to
this command task or set 'command_warnings=False' in ansible.cfg to get rid of this message.

changed: [localhost]

TASK [Enable MariaDB service] ****************************************************************************************************************************
ok: [localhost]

TASK [Create the Helical database user] ******************************************************************************************************************
ok: [localhost]

TASK [Import sample report to Helical database] **********************************************************************************************************
changed: [localhost]

TASK [Set hi-repository path] ****************************************************************************************************************************
ok: [localhost]

TASK [Set BaseURL to listen to] **************************************************************************************************************************
ok: [localhost]

TASK [Configure app with correct helical database user] **************************************************************************************************
ok: [localhost]

TASK [Configure app with correct helical database password] **********************************************************************************************
ok: [localhost]

TASK [Configure app with correct helical database source] ************************************************************************************************
ok: [localhost]

TASK [Fix pom.xml (HikariCP version number) for maven build] *********************************************************************************************
ok: [localhost]

TASK [Maven install] *************************************************************************************************************************************
changed: [localhost]

TASK [Maven build dev] ***********************************************************************************************************************************
changed: [localhost]

TASK [Maven build prod] **********************************************************************************************************************************
changed: [localhost]

TASK [Deploy hi-ce war file] *****************************************************************************************************************************
changed: [localhost]

TASK [Restart tomcat] ************************************************************************************************************************************
changed: [localhost]

TASK [Configure project properties with correct path] ****************************************************************************************************
ok: [localhost]

TASK [Configure logging] *********************************************************************************************************************************
ok: [localhost]

TASK [Configure the database connection] *****************************************************************************************************************
ok: [localhost]

TASK [Configure the database connection and Hibernate dialect] *******************************************************************************************
changed: [localhost]

TASK [Restart tomcat] ************************************************************************************************************************************
changed: [localhost]

TASK [Print BaseURL] *************************************************************************************************************************************
ok: [localhost] => {
    "msg": "Helical Insights will be reachable at: http://35.157.136.233:8080/hi-ce/hi.html"
}

PLAY RECAP ***********************************************************************************************************************************************
localhost                  : ok=24   changed=9    unreachable=0    failed=0   

@changchichung
Copy link

is that really need redhat network credentials ?
I disable the first two task in yml "Register to RHN and auto-subscribe to available content" and "Enable RHSM repositories (extras, optional)" ,and the playbook didnt run well.

TASK [Import sample report to Helical database] ************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "target /opt/helicalinsight/db-dump/SampleTravelData.sql does not exist on the host"}
	to retry, use: --limit @/root/helicalinsight/ansible-installer/install_helical.retry

PLAY RECAP *************************************************************************************************************************************************
localhost                  : ok=4    changed=1    unreachable=0    failed=1  

that seems not related. but I have no idea why that error happened ? I change "helical_hostname" and "install_dir" in vars.yml , that`s all I changed.

OS: CentOS 7

@changchichung
Copy link

OK , looks like the "install_dir" means where I put the files clone for git hub , not where I want to install helical insight .

@mglantz
Copy link
Author

mglantz commented Apr 3, 2019

Hey @changchichung. Right now, I do not have support for CentOS. Check out the documentation at https://github.com/mglantz/helicalinsight/tree/master/ansible-installer. To get CentOS support, we'd have to detect OS and then instead of using subscription-manager, enable the correct repositories with yum-config.

@mglantz
Copy link
Author

mglantz commented Apr 3, 2019

OK , looks like the "install_dir" means where I put the files clone for git hub , not where I want to install helical insight .

Correct, it's where we put the git repo and prep the install. You cannot select where to install it right now, it uses Tomcat and will install it in the default installation directory of Tomcat.

@mglantz
Copy link
Author

mglantz commented Apr 3, 2019

The installer passed my tests on RHEL7. I ended up with a working installation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants