Skip to content

Commit

Permalink
Restart on changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-de-bock committed Mar 22, 2024
1 parent 3b0e2b5 commit 24ec20d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
11 changes: 11 additions & 0 deletions handlers/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
# handler file for terraform_agent

- name: Restart the Terraform Agent
ansible.builtin.service:
name: tfc-agent
state: restarted
when:
- terraform_agent_token is defined
- terraform_agent_token != ""

Check failure on line 11 in handlers/main.yml

View workflow job for this annotation

GitHub Actions / lint

yaml[empty-lines]

Too many blank lines (1 > 0)
6 changes: 6 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
src: "https://releases.hashicorp.com/tfc-agent/{{ terraform_agent_version }}/tfc-agent_{{ terraform_agent_version }}_linux_amd64.zip"
dest: "{{ terraform_agent_installation_path }}"
remote_src: true
notify:
- Restart the Terraform Agent

- name: Place environment variable file
ansible.builtin.template:
Expand All @@ -33,6 +35,8 @@
mode: 0644
owner: root
group: root
notify:
- Restart the Terraform Agent

- name: Place a service file for Terraform Agent
ansible.builtin.template:
Expand All @@ -41,6 +45,8 @@
mode: 0644
owner: root
group: root
notify:
- Restart the Terraform Agent

- name: Start the Terraform Agent
ansible.builtin.service:
Expand Down

0 comments on commit 24ec20d

Please sign in to comment.