Skip to content

Commit

Permalink
Merge pull request #23 from nis65/develop
Browse files Browse the repository at this point in the history
Draft: smaller fixes
  • Loading branch information
fadnincx authored May 30, 2023
2 parents bbe688a + 08027c2 commit 4a100be
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
- name: create ansible inventory
ansible.builtin.copy:
dest: "{{ potos_basics_ansible_inventory }}"
content: "{{ potos_basics_hostname }} ansible_connection=local"
content: "{{ potos_basics_hostname.stdout }} ansible_connection=local"
force: false
owner: root
group: root
Expand Down
5 changes: 3 additions & 2 deletions templates/usr/local/bin/potos-ansible-pull.j2
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ CheckToolAvailable /usr/bin/wall
{{ potos_basics_ansible_workdir }} 2>&1 || die "Failed to checkout playbook repository"
# Adjust ansible config with client
/usr/bin/sed 's|/var/log/potos|{{ potos_basics_ansible_logdir }}|' {{ potos_basics_ansible_workdir }}/ansible.cfg
/usr/bin/sed -i 's|/var/log/potos|{{ potos_basics_ansible_logdir }}|' {{ potos_basics_ansible_workdir }}/ansible.cfg
# Run Ansible with custom ansible.cfg, use flock to prevent concurrent runs
ANSIBLE_CONFIG={{ potos_basics_ansible_workdir }}/ansible.cfg
Expand All @@ -163,6 +163,7 @@ exec {flockfd}</var/lock/{{ potos_basics_client_name | lower }}.lock
source {{ potos_basics_ansible_virtenvdir }}/bin/activate || die "Failed activate virtualenv"
pip3 install ansible-core=={{ potos_basics_ansible_version }} || die "Failed install ansible-core in virtualenv"
cd /var/lib/{{ potos_basics_client_name }}/ansible
ansible-playbook {% if potos_basics_ansible_vault_key_check.stat.exists %}--vault-password-file=/etc/potos/ansible_vault_key {% endif %}-i {{ potos_basics_ansible_inventory }} {{ potos_basics_ansible_workdir }}/prepare.yml -e "{{ potos_basics_ansible_runtype_var_name }}=$RUN_TYPE"
ansible-playbook {% if potos_basics_ansible_vault_key_check.stat.exists %}--vault-password-file=/etc/potos/ansible_vault_key {% endif %}-i {{ potos_basics_ansible_inventory }} {{ potos_basics_ansible_workdir }}/playbook.yml -e "{{ potos_basics_ansible_runtype_var_name }}=$RUN_TYPE"
Expand Down Expand Up @@ -195,4 +196,4 @@ consider to reboot..."
/usr/bin/notify-send -u normal --expire-time=0 "${UPTIME_MESSAGE}"
/usr/bin/wall "${UPTIME_MESSAGE}"
fi
{% endif %}
{% endif %}

0 comments on commit 4a100be

Please sign in to comment.