63 lines
1.9 KiB
YAML
63 lines
1.9 KiB
YAML
---
|
|
- name: Configure Local DNS Resolution on This Workstation
|
|
hosts: localhost
|
|
connection: local
|
|
become: true
|
|
vars:
|
|
npm_server_ip: "192.168.200.71"
|
|
directlx_domains:
|
|
- gitea.directlx.dev
|
|
- smartjournal.directlx.dev
|
|
- directlx.dev
|
|
- www.directlx.dev
|
|
- registry.directlx.dev
|
|
|
|
tasks:
|
|
- name: Backup /etc/hosts
|
|
ansible.builtin.copy:
|
|
src: /etc/hosts
|
|
dest: "/etc/hosts.backup-{{ ansible_date_time.epoch }}"
|
|
remote_src: true
|
|
mode: '0644'
|
|
changed_when: false
|
|
|
|
- name: Add DirectLX local DNS entries
|
|
ansible.builtin.blockinfile:
|
|
path: /etc/hosts
|
|
marker: "# {mark} DirectLX Local DNS"
|
|
block: |
|
|
# DirectLX services - use local NPM server
|
|
{% for domain in directlx_domains %}
|
|
{{ npm_server_ip }} {{ domain }}
|
|
{% endfor %}
|
|
create: false
|
|
backup: false
|
|
|
|
- name: Test DNS resolution
|
|
ansible.builtin.shell: |
|
|
echo "Testing DNS resolution..."
|
|
getent hosts gitea.directlx.dev
|
|
echo ""
|
|
echo "Testing HTTPS connectivity..."
|
|
curl -I --max-time 5 https://gitea.directlx.dev 2>&1 | head -3
|
|
register: test_results
|
|
changed_when: false
|
|
failed_when: false
|
|
|
|
- name: Display results
|
|
ansible.builtin.debug:
|
|
msg: |
|
|
============================================================
|
|
✅ Local DNS Configuration Complete!
|
|
============================================================
|
|
|
|
{{ test_results.stdout }}
|
|
|
|
You can now access DirectLX services reliably:
|
|
- https://gitea.directlx.dev
|
|
- https://smartjournal.directlx.dev
|
|
- https://registry.directlx.dev (Docker Registry)
|
|
|
|
All domains resolve to NPM: {{ npm_server_ip }}
|
|
============================================================
|