From 75820107482949411c0fffed8427ffb105ae3ca4 Mon Sep 17 00:00:00 2001 From: Gleb Koval Date: Wed, 6 Sep 2023 01:35:34 +0100 Subject: [PATCH] update hostname --- infra/joplin/0000_proxmox_playbook.yaml | 6 ++++-- inventory/proxmox.yaml | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/infra/joplin/0000_proxmox_playbook.yaml b/infra/joplin/0000_proxmox_playbook.yaml index dc7e89d..14da83e 100644 --- a/infra/joplin/0000_proxmox_playbook.yaml +++ b/infra/joplin/0000_proxmox_playbook.yaml @@ -1,12 +1,14 @@ - name: Provision joplin Proxmox VM - hosts: localhost + hosts: joplin + connection: ansible.builtin.local + gather_facts: false vars: api_user: "{{ lookup('ansible.builtin.env', 'PROXMOX_USER') }}" api_host: "{{ lookup('ansible.builtin.env', 'PROXMOX_HOST' ) }}" api_token_id: "{{ lookup('ansible.builtin.env', 'PROXMOX_TOKEN_ID') }}" api_token_secret: "{{ lookup('ansible.builtin.env', 'PROXMOX_TOKEN_SECRET') }}" ssh_public: "{{ lookup('ansible.builtin.env', 'SSH_PUBLIC') }}" - vmname: joplin + vmname: "{{ inventory_hostname | regex_replace('^([^\\.]+)\\..+$', '\\1') }}" node: pve module_defaults: community.general.proxmox_kvm: diff --git a/inventory/proxmox.yaml b/inventory/proxmox.yaml index 00ca438..f888c38 100644 --- a/inventory/proxmox.yaml +++ b/inventory/proxmox.yaml @@ -10,7 +10,7 @@ proxmox: children: joplin: hosts: - joplin.srv.home.local.koval.net: + joplin2.srv.home.local.koval.net: vars: ansible_user: debian ansible_ssh_private_key_file: ~/.ssh/id_rsa