bob-builds-labs

Working with windows file Agent

Prerequisite

Make sure you prepared the environment using ansible_ppdm_agents
Make sure the “File VM” is started

ansible-playbook ../playbooks/start_stop_vms_by_vm_names.yaml -e vm_names='file' -e state=start

it will take a while for the VM to be running. Check it is reachable using win_ping

Validate agent hostgroup “filehosts” ping-able via winrm

ansible filehosts -m win_ping -i hosts.yaml

once we receive a “pong” the machines are up and reachable for ansible communication´s image

Some hosts might have manually altered hosts files. We do not want this as we use DNS for Agents in the Scenario. The Following Playbook will clear hosts for the scope og filehosts ( launchpad and file.demo.local )

ansible-playbook ~/workspace/ansible_ppdm/100.3_playbook_clear_hosts_windows_agent.yaml -i hosts.yaml --limit filehosts,

Installing the File Agent

deploy agents to hostgroup “filehosts”

The example will use the Inventory from the previously create file “hosts.yaml”.
As we only want to tackle the hostgroup named filehosts, we use the –limit parameter the host list for parameter –limit must end with a comma

ansible-playbook ~/workspace/ansible_ppdm/100.3_playbook_copy_and_deploy_windows_agent.yaml -i hosts.yaml --limit filehosts, 

View Agent registration Status

ansible-playbook ~/workspace/ansible_ppdm/100.5_get_agent_registration_status.yaml

image

The Agent will also be visbile as “Waiting Approval” in the UI

image

Agent not Showing Up ??

Smetimes the AgentService, even deployed successfully, doesn´t register with the PPDM Host. This might be due to an delayed agent startup issue.

The following runbook will try to start the Agent:

ansible-playbook ~/workspace/ansible_ppdm/100.3_playbook_check_AgentService.yaml -i hosts.yaml --limit filehosts, 

Approve File Agent

as we could see from the Agent registration Status, the Agent´s address is the primary IP Address. We need to Approve the Host with a whitelist using the primary IP Address.

ansible-playbook ~/workspace/ansible_ppdm/100.4_create_whitelistentry.yaml -e "host_list=192.168.1.107,192.168.1.2"

image

the agent status should transfer to Approving Certificates

image

And finally to registered:

image

ansible-playbook ~/workspace/ansible_ppdm/100.5_get_agent_registration_status.yaml

image

Back to Index