Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
DemisT
Participant
Jump to solution

Automating GAIA API installation with Ansible

Hi all, I'm trying to make a playbook to automate the installation of the GAIA API on a Check Point (virtual) appliance as per sk143612.

Here are the steps in the article:

  1. Download the engine package to your machine.
  2. Open the tgz file: tar -zxvf Check_Point_gaia_api.tgz
  3. Run the installer: ./install_gaia_api.sh  
  4. Run gaia_api status to verify it is up and running

I created an ansible playbook:

- name: Create gaia_api directory
  file:
    path: /var/log/gaia_api
    state: directory

- name: SCP and extract gaia_api package
  unarchive:
    src: Check_Point_gaia_api.tgz
    dest: /var/log/gaia_api
    mode: u+x,g+x,o+x

- name: Install gaia_api
  raw: sh /var/log/gaia_api/install_gaia_api.sh
  ignore_errors: yes
 
It works, up until the last task. Doing a gaia_api status shows: "-bash: /bin/gaia_api: No such file or directory"
 
I also tried the following:
 
- name: Install gaia_api
  command: /var/log/gaia_api/install_gaia_api.sh
  args:
    executable: /bin/bash
 
even tried copying the install_gaia_api.sh script to my Ansible machine and using the script module:
 
- name: Install gaia_api
  script: install_gaia_api.sh
 
Any suggestions?
0 Kudos
1 Solution

Accepted Solutions
PhoneBoy
Admin
Admin
You're not doing exactly what the installation instructions say to do, which is run the installation script in the current working directory (e.g. using ./install_gaia_api.sh).
I recommend running the commands manually from an ssh session precisely as you're trying to do it from the Ansible playbook and debug it from there.

View solution in original post

2 Replies
PhoneBoy
Admin
Admin
You're not doing exactly what the installation instructions say to do, which is run the installation script in the current working directory (e.g. using ./install_gaia_api.sh).
I recommend running the commands manually from an ssh session precisely as you're trying to do it from the Ansible playbook and debug it from there.
DemisT
Participant

Hi Dameon,

Thanks! figured it out.

Changed the task to:

- name: Install gaia_api
  command: sh ./install_gaia_api.sh
  args:
    chdir: /var/log/gaia_api

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events