How to convert this to ansible?

Download from: \…COM\C_CFG_Users\ittshare\UCD\ibm-ucd-agent6.2.7.3.zip to the local machine
Copy file in step 1 to the Unix Server
Place the ucd agent install package ibm-ucd-agent6.2.7.3.zip in the directory /apps/udeploy
Unzip the Agent Install package unzip ibm-ucd-agent6.2.7.3.zip
Cd to the newly created directory of ibm-ucd-agent-install cd ibm-ucd-agent-install
see step 7 for the install.
Click on the link to download java. Download the latest Java runtime 64-bit.

Install Agents for Linux/UNIX
Run shell script: install-agent.sh. You may see error “Unable to locate tools.jar…” No action needed for this
./install-agent.sh
Below are the prompts and responses for running the shell script for Linux servers:

At this prompt: [echo] Enter the directory where agent should be installed. y,N [Default: /opt/ibm-ucd/agent]
Copy and paste this link on the cursor: /apps/udeploy/agent_[instance]_[run as user]
Note: [run as user] = the id that will be running the agent.

At this prompt: Please enter the home directory of the JRE/JDK used to run this agent. y,N [Default: /apps/udeploy/java/current
This should be the path from above set at Java Installation step 7a.
If this is the case take the default, otherwise restart the JAVA installation

At this prompt: [echo] will the agent connect to an agent relay instead of directly to the server? y,N [Default: N] Type: Y. Press Enter.
At this prompt: [echo] Enter the hostname or address of the agent relay the agent will connect to.
Type in proper hostname (match datacenter) according to the spreadsheet attached to the WO.

Example: …com

At this prompt: [echo] Enter the agent communication port for the agent relay. y,N [Default: 7916]
Press Enter.

At this prompt: [echo] Do you want to configure another failover relay connection? y,N [Default: N]
Press Enter.

At this prompt: [echo] Enter the hostname or address of the HTTP proxy server for the agent relay. [Default: …com]
Example: …com

At this prompt: [echo] Enter the HTTP proxy port for the agent relay. [Default: 20080]
Press Enter.

At this prompt: [echo] Do you want to disable HTTP Failover Handling? This is necessary if the relay is behind a firewall and accessed through a load balancer. [Default: N]
Press Enter.

At this prompt: [echo] Enable mutual (two-way) authentication with SSL for server/agent JMS communication? This setting must match that of the server. [Default: N]
Press Enter.

[echo] End-to-end encryption enhances the security of UrbanCode messages sent between

 [echo] the agent and the server, and requires an initial HTTPS connection to set up

 [echo] keys. (WARNING: If your server has been configured to require end-to-end

 [echo] encryption exclusively, you must not disable this agent feature and must supply

 [echo] the full web URL below or your agent will not come online.)

 [echo]

 [echo] Disable end-to-end encryption for server/agent JMS communication? y,N [Default: N]

Press Enter.

At this prompt: [echo] Enable the agent to verify the server HTTPS certificate? If enabled, you must import the server certificate to the JRE keystore on the agent.[Default: N]
Press Enter.

At the message :
[echo] Enter the full web URL for the central IBM UrbanCode Deploy server to validate

 [echo] the connection. (WARNING: If your server has been configured to require

 [echo] end-to-end encryption exclusively, you must supply the URL here or your agent

 [echo] will not come online.)

 [echo] Leave empty to skip.

 Press Enter.

At this prompt: [echo] Enter the name for this agent. [Default: abc.com]
See WO spreadsheet attachment for agent name

Type

[ServerName][instance][run as user]

At this prompt: [echo] The agent can be added to one or more teams when it first connects to the server. Changing this setting after initial connection to the server will not have any effect. You can also add a specific type associated with a team by using the format :[echo] Enter teams (and types) to add this agent to, separated by commas. [Default: None]
Type UCD_ILT and Press Enter.

If the last line of the screen is [echo] Installer Complete. (press return to exit installer) – installation is complete for the agent.
Press Enter.
Start the agent:
/apps/udeploy/agent_[instance]_[run as user]/bin/agent start
ps –ef | grep udeploy

Install Startup Script
Download an execution setup for Linux in order to automate agent start and restarts.

If this is a reinstall – do not execute this step until the agent-id has been updated with the old agent-id for agents that were uninstalled with previous components mapped. See Reinstall Section.

Note:

You must run this as root

Make a copy of the file $AGENT_HOME/bin/init/agent, where the $AGENT_HOME is the installation folder of the agent. If you are running multiple agents on the system, give the file a unique name, such as udeploy_[instance]_[run as user]
In a text editor, edit the above file: ?Set the property AGENT_USER to the name of the user that runs the agent.
?Set the property AGENT_GROUP to the name of the group that is associated with that user.
AGENT_USER=”[run as user] “

AGENT_GROUP=“[group for run as user]”

Configure the agent to run when the system starts. The steps depend on how your system manages services. For example, for Linux systems that use init.d, follow these steps:
move the file udeploy_[instance][run as user] to the folder /etc/rc.d/init.d/
Add the file to runlevels 3, 4, and 5. For example, in this case, run the following commands:
ln -s /etc/rc.d/init.d/udeploy
[instance][run as user] /etc/rc.d/rc5.d/S98udeploy[instance][run as user]
chkconfig --add udeploy
[instance]_[run as user]

chkconfig

ln -s /etc/rc.d/init.d/udeploy_[instance][run as user] /etc/rc.d/rc4.d/S98udeploy[instance]_[run as user]

ln -s /etc/rc.d/init.d/ibm-ucdagent /etc/rc.d/rc3.d/S98udeploy_[instance]_[run as user]

Verify that the file is on runlevels 3, 4, and 5 by running the following command:
chkconfig udeploy_[instance]_[run as user] --list

The result of the command should look like the following code:
udeploy_[instance]_[run as user] 0:off 1:off 2:off 3:on 4:on 5:on 6:off

Stop and Start the agent using the startup script:
service udeploy_[instance][run as user] stop
service udeploy
[instance]_[run as user] start

ps –ef | grep udeploy

This forum isn’t here for people to code for you, it is for us to help people who have issues with code.

You should use the Ansible documentation and Google to figure out how to do each step you have listed, and build out a playbook and/or role piece by piece, troubleshooting as needed.

If/when you have issues that you cannot seem to get by, then feel free to post here.

Good luck!

3 Likes