robertdebock / ansible-role-ara

Install and configure ara on your system.
https://robertdebock.nl/
Apache License 2.0
6 stars 3 forks source link

Startup script throws error. #1

Closed robertdebock closed 6 years ago

robertdebock commented 6 years ago
ISSUE TYPE
SUMMARY
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Error loading unit file 'ara': System.Error.ENOEXEC \"Exec format error\""}
shah commented 6 years ago

@robertdebock I got this error today on Ubuntu 18.04 LTS after installing from ansible galaxy.

I noticed you closed this error earlier, is there some debugging I can do to understand why it's occuring?

robertdebock commented 6 years ago

I'll try to reproduce this issue on Ubuntu 18.04. Not sure why I closed the issue.

robertdebock commented 6 years ago

Error found; the service script now contains:

[Unit]
Description=Ansible Runtime Analyser

[Service]
Type=simple
ExecStart={u'default': u'/usr/bin', u'Debian': u'/usr/local/bin', u'Ubuntu': u'/usr/local/bin'}/ara-manage runserver
ExecStop=/usr/bin/killall ara-manage

[Install]
WantedBy=multi-user.target

That ExecStart comes from vars/main.yml. The templates/ara.service.j2 should lookup the value based on the distribution.

I'll change it, and release a new version a bit later.

robertdebock commented 6 years ago

There are some tests running now, expect the role to be available on Galaxy in 2 hours or so.

shah commented 6 years ago

Thanks for the quick turnaround, @robertdebock -- I checked and Galaxy hasn't been updated as of a few minutes ago but I'll try it again once it is.

robertdebock commented 6 years ago

There seems to be a (problem at travis](https://www.traviscistatus.com/), when that's resolved, the new release should start building... I'm going to guess that's later today.

In case you need a quick solution, copy/paste this version of the template into the role you downloaded from Galaxy.

I'll open the issue until the release is done and this update is published to Galaxy.

shah commented 6 years ago

Thanks for the update, I'll take a peek in a bit to see if Travis is rolling again.

dmsimard commented 6 years ago

:+1:

shah commented 6 years ago

I reran the build and the errors went away and the install completed without errors. However, when I run my playbooks the ARA website running on :9191 doesn't seem to record anything (just shows the home screen with "About" information).

I looked in ansible.cfg and the plugins are referenced there. Should I check anything else?

Or, do I need to make any other changes before running my playbooks?

robertdebock commented 6 years ago

You can leave the playbooks as is, could it be that you have another ansible.cfg? Look at the Ansible documentation, it states the order:

You can instruct the ara role to write to another file:

# The ansible.cfg to modify.
ara_configuration_file: /etc/ansible/ansible.cfg

So ansible-playbook -e "ara_configuration_file=/path/to/your/ansible.cfg".

Hope it helps!

shah commented 6 years ago

Good question, @robertdebock -- I'm using /etc/ansible/ansible.cf and my script is pretty simple, it's just this one file:

https://github.com/shah/appliance-setup-framework/blob/master/bin/bootstrap.sh

If I create a fresh VM and run the above, everything seems to work, but for some reason ARA doesn't seem to record.

If you have a moment to run that script on a fresh VM it might shed some light but I'll keep hunting for a cause as well. Thanks!

robertdebock commented 6 years ago

It works for me, so here is exactly what I've done:

Created a new machine with vagrant:

Vagrant.configure("2") do |config|
  config.vm.define "ubuntu" do |ubuntu|
    ubuntu.vm.box = "generic/ubuntu1804"
    ubuntu.vm.synced_folder '.', '/vagrant', disabled: true
  end
end

And start it using vagrant up.

Log in and copy paste your scrip, pretty nice by the way. vagrant ssh and sudo su -.

Ran the script:

./iets.sh 

Install Python and Ansible
Reading package lists... Done
Building dependency tree       
Reading state information... Done
software-properties-common is already the newest version (0.96.24.32.5).
0 upgraded, 0 newly installed, 0 to remove and 50 not upgraded.
Get:1 http://ppa.launchpad.net/ansible/ansible/ubuntu bionic InRelease [15.9 kB]
Get:2 http://security.ubuntu.com/ubuntu bionic-security InRelease [83.2 kB]    
Get:3 http://ppa.launchpad.net/ansible/ansible/ubuntu bionic/main i386 Packages [540 B]
Hit:4 http://us.archive.ubuntu.com/ubuntu bionic InRelease                     
Get:5 http://ppa.launchpad.net/ansible/ansible/ubuntu bionic/main amd64 Packages [540 B]
Get:6 http://ppa.launchpad.net/ansible/ansible/ubuntu bionic/main Translation-en [344 B]
Get:7 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]   
Get:8 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Fetched 264 kB in 1s (247 kB/s)    
Reading package lists... Done
'universe' distribution component is already enabled for all sources.
Hit:1 http://ppa.launchpad.net/ansible/ansible/ubuntu bionic InRelease
Hit:2 http://security.ubuntu.com/ubuntu bionic-security InRelease            
Hit:3 http://us.archive.ubuntu.com/ubuntu bionic InRelease                     
Hit:4 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:5 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease
Reading package lists... Done
Reading package lists... Done
Building dependency tree       
Reading state information... Done
make is already the newest version (4.1-9.1ubuntu1).
make set to manually installed.
curl is already the newest version (7.58.0-2ubuntu3.3).
wget is already the newest version (1.19.4-1ubuntu2.1).
python-pip is already the newest version (9.0.1-2.3~ubuntu1).
The following additional packages will be installed:
  python-httplib2 python-jinja2 python-markupsafe python-paramiko
  python-pyasn1 python-yaml sshpass
Suggested packages:
  git-daemon-run | git-daemon-sysvinit git-doc git-el git-email git-gui gitk
  gitweb git-cvs git-mediawiki git-svn python-jinja2-doc python-gssapi
The following NEW packages will be installed:
  ansible python-httplib2 python-jinja2 python-markupsafe python-paramiko
  python-pyasn1 python-yaml sshpass
The following packages will be upgraded:
  git
1 upgraded, 8 newly installed, 0 to remove and 49 not upgraded.
Need to get 8,245 kB of archives.
After this operation, 36.6 MB of additional disk space will be used.
Get:1 http://ppa.launchpad.net/ansible/ansible/ubuntu bionic/main amd64 ansible all 2.7.1-1ppa~bionic [3,922 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 python-markupsafe amd64 1.0-1build1 [13.0 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 python-jinja2 all 2.10-1 [94.6 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 python-yaml amd64 3.12-1build2 [115 kB]
Get:5 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 python-pyasn1 all 0.4.2-3 [46.7 kB]
Get:6 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 python-paramiko all 2.0.0-1ubuntu1.1 [110 kB]
Get:7 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 python-httplib2 all 0.9.2+dfsg-1 [34.6 kB]
Get:8 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 sshpass amd64 1.06-1 [10.5 kB]
Get:9 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 git amd64 1:2.17.1-1ubuntu0.3 [3,898 kB]
Fetched 8,245 kB in 3s (3,255 kB/s)                                
Selecting previously unselected package python-markupsafe.
(Reading database ... 115869 files and directories currently installed.)
Preparing to unpack .../0-python-markupsafe_1.0-1build1_amd64.deb ...
Unpacking python-markupsafe (1.0-1build1) ...
Selecting previously unselected package python-jinja2.
Preparing to unpack .../1-python-jinja2_2.10-1_all.deb ...
Unpacking python-jinja2 (2.10-1) ...
Selecting previously unselected package python-yaml.
Preparing to unpack .../2-python-yaml_3.12-1build2_amd64.deb ...
Unpacking python-yaml (3.12-1build2) ...
Selecting previously unselected package python-pyasn1.
Preparing to unpack .../3-python-pyasn1_0.4.2-3_all.deb ...
Unpacking python-pyasn1 (0.4.2-3) ...
Selecting previously unselected package python-paramiko.
Preparing to unpack .../4-python-paramiko_2.0.0-1ubuntu1.1_all.deb ...
Unpacking python-paramiko (2.0.0-1ubuntu1.1) ...
Selecting previously unselected package python-httplib2.
Preparing to unpack .../5-python-httplib2_0.9.2+dfsg-1_all.deb ...
Unpacking python-httplib2 (0.9.2+dfsg-1) ...
Selecting previously unselected package sshpass.
Preparing to unpack .../6-sshpass_1.06-1_amd64.deb ...
Unpacking sshpass (1.06-1) ...
Selecting previously unselected package ansible.
Preparing to unpack .../7-ansible_2.7.1-1ppa~bionic_all.deb ...
Unpacking ansible (2.7.1-1ppa~bionic) ...
Preparing to unpack .../8-git_1%3a2.17.1-1ubuntu0.3_amd64.deb ...
Unpacking git (1:2.17.1-1ubuntu0.3) over (1:2.17.1-1ubuntu0.1) ...
Setting up python-yaml (3.12-1build2) ...
Setting up python-pyasn1 (0.4.2-3) ...
Setting up python-markupsafe (1.0-1build1) ...
Setting up python-httplib2 (0.9.2+dfsg-1) ...
Setting up python-paramiko (2.0.0-1ubuntu1.1) ...
Setting up sshpass (1.06-1) ...
Processing triggers for man-db (2.8.3-2) ...
Setting up git (1:2.17.1-1ubuntu0.3) ...
Setting up python-jinja2 (2.10-1) ...
Setting up ansible (2.7.1-1ppa~bionic) ...

Configuration file '/etc/ansible/ansible.cfg'
 ==> File on system created by you or by a script.
 ==> File also in package provided by package maintainer.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** ansible.cfg (Y/I/N/O/D/Z) [default=N] ? d

Configuration file '/etc/ansible/ansible.cfg'
 ==> File on system created by you or by a script.
 ==> File also in package provided by package maintainer.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** ansible.cfg (Y/I/N/O/D/Z) [default=N] ? y
Installing new version of config file /etc/ansible/ansible.cfg ...

Install roles from Ansible Galaxy
- downloading role 'zsh', owned by viasite-ansible
- downloading role from https://github.com/viasite-ansible/ansible-role-zsh/archive/v3.2.2.tar.gz
- extracting viasite-ansible.zsh to /root/.ansible/roles/viasite-ansible.zsh
- viasite-ansible.zsh (v3.2.2) was installed successfully
- downloading role 'ara', owned by robertdebock
- downloading role from https://github.com/robertdebock/ansible-role-ara/archive/1.2.3.tar.gz
- extracting robertdebock.ara to /root/.ansible/roles/robertdebock.ara
- robertdebock.ara (1.2.3) was installed successfully

Download distribution into /etc/appliance-setup-framework
Cloning into '/etc/appliance-setup-framework'...
remote: Enumerating objects: 145, done.
remote: Counting objects: 100% (145/145), done.
remote: Compressing objects: 100% (132/132), done.
remote: Total 145 (delta 85), reused 23 (delta 8), pack-reused 0
Receiving objects: 100% (145/145), 6.11 MiB | 1.80 MiB/s, done.
Resolving deltas: 100% (85/85), done.

Prepare appliance secrets configuration

Provision ARA setup playbook

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

TASK [Gathering Facts] ***************************************************************************************
ok: [localhost]

TASK [robertdebock.ara : install required packages] **********************************************************
ok: [localhost]

TASK [robertdebock.ara : install ara] ************************************************************************
ok: [localhost]

TASK [robertdebock.ara : register ara to a sysvinit system] **************************************************
skipping: [localhost]

TASK [robertdebock.ara : register ara to a systemd system] ***************************************************
ok: [localhost]

TASK [robertdebock.ara : find callback_plugins path] *********************************************************
ok: [localhost]

TASK [robertdebock.ara : configure ansible to use ara] *******************************************************
changed: [localhost]

TASK [robertdebock.ara : configure ansible to use ara] *******************************************************
skipping: [localhost]

TASK [robertdebock.ara : start and enable ara] ***************************************************************
ok: [localhost]

RUNNING HANDLER [robertdebock.ara : restart ara] *************************************************************
changed: [localhost]

PLAY RECAP ***************************************************************************************************
localhost                  : ok=8    changed=2    unreachable=0    failed=0   

Provision ZSH setup playbook for root

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

TASK [Gathering Facts] ***************************************************************************************
ok: [localhost]

TASK [viasite-ansible.zsh : Install zsh, git, wget] **********************************************************
changed: [localhost] => (item=zsh)
ok: [localhost] => (item=git)
ok: [localhost] => (item=wget)

TASK [viasite-ansible.zsh : Clone antigen master] ************************************************************
changed: [localhost]

TASK [viasite-ansible.zsh : Clone iwfmp/mc-solarized-skin] ***************************************************
skipping: [localhost]

TASK [viasite-ansible.zsh : Check fzf installed] *************************************************************
ok: [localhost]

TASK [viasite-ansible.zsh : Download fzf] ********************************************************************
changed: [localhost]

TASK [viasite-ansible.zsh : Set directory permissions] *******************************************************
ok: [localhost]

TASK [viasite-ansible.zsh : Check zsh version] ***************************************************************
ok: [localhost]

TASK [viasite-ansible.zsh : Set zsh_version variable] ********************************************************
ok: [localhost]

TASK [viasite-ansible.zsh : Merge bundles lists] *************************************************************
[DEPRECATION WARNING]: Using tests as filters is deprecated. Instead of using `result|version_compare` use 
`result is version_compare`. This feature will be removed in version 2.9. Deprecation warnings can be 
disabled by setting deprecation_warnings=False in ansible.cfg.
ok: [localhost]

TASK [viasite-ansible.zsh : Check commands exists] ***********************************************************
skipping: [localhost] => (item={u'when': True, u'name': u'command-not-found'}) 
ok: [localhost] => (item={u'command': u'brew', u'name': u'brew'})
ok: [localhost] => (item={u'command': u'docker', u'name': u'docker'})
ok: [localhost] => (item={u'command': u'docker-compose', u'name': u'docker-compose'})
skipping: [localhost] => (item=fancy-ctrl-z) 
skipping: [localhost] => (item=git-extras) 
skipping: [localhost] => (item=gnu-utils) 
ok: [localhost] => (item={u'command': u'http', u'name': u'httpie'})
ok: [localhost] => (item={u'command': u'go', u'name': u'go'})
ok: [localhost] => (item={u'command': u'gulp', u'name': u'gulp'})
ok: [localhost] => (item={u'command': u'pip', u'name': u'pip'})
ok: [localhost] => (item={u'command': u'rake', u'name': u'rake'})
ok: [localhost] => (item={u'command': u'symfony', u'name': u'symfony2'})
ok: [localhost] => (item={u'command': u'systemctl', u'name': u'systemd'})
skipping: [localhost] => (item=python) 
ok: [localhost] => (item={u'command': u'tmux', u'name': u'tmux'})
ok: [localhost] => (item={u'command': u'vagrant', u'name': u'vagrant'})
ok: [localhost] => (item={u'command': u'drall', u'name': u'viasite/drall'})
ok: [localhost] => (item={u'command': u'drs', u'name': u'viasite/drupal-scripts'})
ok: [localhost] => (item={u'command': u'dbdump', u'name': u'viasite/server-scripts'})
ok: [localhost] => (item={u'command': u'ansible-deploy', u'name': u'viasite-ansible/zsh-ansible-server'})
skipping: [localhost] => (item=zsh_reload) 
skipping: [localhost] => (item={u'when': True, u'name': u'zsh-users/zsh-autosuggestions'}) 
skipping: [localhost] => (item=popstas/zsh-command-time) 
skipping: [localhost] => (item={u'when': True, u'name': u'unixorn/autoupdate-antigen.zshplugin'}) 
skipping: [localhost] => (item=urbainvaes/fzf-marks) 
skipping: [localhost] => (item=ytet5uy4/fzf-widgets) 
skipping: [localhost] => (item={u'when': True, u'name': u'zdharma/fast-syntax-highlighting'}) 
skipping: [localhost] => (item=colored-man-pages) 
skipping: [localhost] => (item=joel-porquet/zsh-dircolors-solarized.git) 

TASK [viasite-ansible.zsh : Merge hotkeys lists] *************************************************************
ok: [localhost]

TASK [viasite-ansible.zsh : Check antigen version] ***********************************************************
ok: [localhost]

TASK [viasite-ansible.zsh : Set zsh_antigen_installed_version variable] **************************************
ok: [localhost]

TASK [viasite-ansible.zsh : Write .zshrc config] *************************************************************
[DEPRECATION WARNING]: Using tests as filters is deprecated. Instead of using `result|version_compare` use 
`result is version_compare`. This feature will be removed in version 2.9. Deprecation warnings can be 
disabled by setting deprecation_warnings=False in ansible.cfg.
changed: [localhost]

TASK [viasite-ansible.zsh : Set zsh as default shell] ********************************************************
changed: [localhost]

TASK [viasite-ansible.zsh : Add skip_global_compinit for disable early compinit call in Ubuntu] **************
changed: [localhost]

TASK [viasite-ansible.zsh : Reset antigen cache] *************************************************************
ok: [localhost]

TASK [viasite-ansible.zsh : Update antigen bundles] **********************************************************
ok: [localhost]

TASK [viasite-ansible.zsh : Reset antigen cache] *************************************************************
ok: [localhost]

PLAY RECAP ***************************************************************************************************
localhost                  : ok=19   changed=6    unreachable=0    failed=0   

****************************************************
** ASF boostrapping process is complete.          **
** ---------------------------------------------- **
** Exit the shell, then log back in to continue   **
** the appliance setup process.                   **
****************************************************

And opened the web interface, looks okay, I see one play:

For that webpage to see I had to setup an SSH tunnel: Add the config to ~/.ssh/config:

vagrant ssh-config | tee -a ~/.ssh/config
Host ubuntu
  HostName 192.168.121.225
  User vagrant
  Port 22
  UserKnownHostsFile /dev/null
  StrictHostKeyChecking no
  PasswordAuthentication no
  IdentityFile /home/robertdb/Documents/ansible/tester/.vagrant/machines/ubuntu/libvirt/private_key
  IdentitiesOnly yes
  LogLevel FATAL

And setup the tunnel:

ssh -L 9191:localhost:9191 ubuntu

Now I could visit: http://localhost:9191/

Hope this helps you.