Skip to content

Commit

Permalink
Use ansible_user in customize_home role
Browse files Browse the repository at this point in the history
This was only working when run under the vagrant user
  • Loading branch information
wbclark committed Feb 13, 2024
1 parent 53105c5 commit 0c865ba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions roles/customize_home/tasks/fix_env.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
- name: Check that the .env exists
stat:
path: /home/vagrant/foreman/.env
path: "{{ ansible_user_dir }}/foreman/.env"
register: stat_result

- name: Ensure .env file contains current hostname
ansible.builtin.replace:
path: /home/vagrant/foreman/.env
path: "{{ ansible_user_dir }}/foreman/.env"
regexp: '(.*)--public [a-zA-Z0-9-\.]*(.*)'
replace: '\1--public {{ ansible_fqdn }}\2'
when: stat_result

0 comments on commit 0c865ba

Please sign in to comment.