0

I'm working on modifying ansible task to install IBM connect direct in EC2 instance. However, It's failing at following stage

# Add config files
- block:
  - name: Add netmap.cfg
    template:
      src: "cfg/netmap.cfg"
      dest: "{{ install_dir }}/ndm/cfg/{{ node_name }}/netmap.cfg"
  - name: Add userfile.cfg
    template:
      src: "cfg/userfile.cfg"
      dest: "{{ install_dir }}/ndm/cfg/{{ node_name }}/userfile.cfg"
Note: value of install_dir in variable file
# Target location of the install, owned by `cd_user_name`
install_dir: '/opt/connectdirect'

# The node name of this box. This must be shared with the team.
node_name: CD.STK

# The user name running C:D. This must be shared with the team.
cd_user_name: abc

Error

TASK [connect-direct : Add netmap.cfg] ************************************************************************************************************
fatal: [10.245.124.252]: FAILED! => {"changed": false, "checksum": "e369f94df4be277b71a62946a899e0246362ea4c", "msg": "Destination directory /opt/connectdirect/ndm/cfg/CD.STK does not exist"}

What I did to verify

I sshed into EC2 instance and went to /opt/connectdirect/ndm/cfg/ path and saw that CD.STK doesn't exist hence the error is there.

What I am not sure of

Since I've never installed connect_direct software utility for file transfer, I am not sure if it is suppose to create CD.STK (value of node_name variable) directory in /opt/connectdirect/ndm/cfg/ during installation. When I was checking the code, I saw that it has following section where {{ node_name }} is being passed during installation task

- name: Run the Connect:Direct installer
  expect:
    echo: yes
    chdir: "{{ install_work_dir }}"
    command: "./cdinstall"
    timeout: 300
    responses:
      #there's other responses before/after below-mentioned responses here which I've not posted 
      # here to keep the post as small as possible. Fyi, Installation task ran successfully.
      
      # Choose node name
      (.*)Please enter name of Connect:Direct node you want to customize(.*): "{{ node_name }}"
      # Configure server network settings
      (.*)Enter TCP\/IP port to listen for a remote connection request:\[1234\](.*): "\n"
      (.*)Enter TCP\/IP hostname to listen for a remote connection request:\[0.0.0.0\](.*): "\n"
      (.*)Enter TCP\/IP port to listen for a Client connection request:\[1233\](.*): "\n"
      (.*)Enter TCP\/IP hostname to listen for a Client connection request:\[.+\](.*): "localhost\n"

Could you please suggest me what needs to be done?

Should I create /opt/connectdirect/ndm/cfg/CD.STK using seperate task and then transfer *.cfg files in it? I am asking here to see if it is okay to create dir using separate task. Since I am not sure but guessing this dir(or path) should have been created during installation process, I am asking here to see it running task to create CD.STK doesn't break any functionality since some other team will use this info(username/node name) to transfer the data.

  • `Should I create /opt/connectdirect/ndm/cfg/CD.STK using seperate task and then transfer *.cfg files in it?` => didn't you try already to see if it fixes your issue ? – Zeitounator Dec 13 '20 at 09:09
  • @Zeitounator: It might but my concern is that should I expect it from installation process (i.e. folder should be created during installation process) or should I go ahead and manually create it? – 1stYrTechStudent Dec 14 '20 at 04:37
  • If this is your actual question, it is [off-topic](/help/on-topic) here (not related to programming). I personally have no idea. Try superuser.com – Zeitounator Dec 14 '20 at 07:16

0 Answers0