Skip to content

Latest commit

 

History

History
31 lines (21 loc) · 1.35 KB

README.md

File metadata and controls

31 lines (21 loc) · 1.35 KB

hname

Print the hostname with a timestamp into a file periodically.

Requirements

Limitations

  • Works on Linux distributions that use systemd.
  • On the Windows hosts, the service fails after n restart attempts could not be configured due to the current limitation of the ansible module. This is an ongoing development. See more at ansible/ansible#56445

Install

Populate the ansible hosts file at /etc/ansible/hosts. A sample hosts file given in this repository. Separate ansible playbooks are given for Linux and Windows deployments. Adjust the time period to run the script; the systemd user and Windows user to run the service in the group_vars/all.yml file.

Note One should use Ansible Vault to store secrets/password for security reasons.

Clone this repository,

        git clone https://github.com/shahriar52/hname.git
        cd hname

Linux

For the Linux machines run ansible playbooks as follows:

        ansible-playbook -l linux -i hosts linux.yml -K -b -u <ansible_user>

Windows

For the Windows hosts run ansible playbooks as follows:

        ansible-playbook -l windows -i hosts windows.yml