u/redditphantom

AdGuard Home Plugin VIP assignment possible?

So I am in the process of migrating to OPNSense from pfsense and I am making a number of changes to my setup as I go. One thing is I currently use pfblockerng and I am moving to adguard home. In my testing I set up the adguard home plugin and it worked fine however as I add this to my new environment I thought it might be useful to have the web interface for adguard home run on a VIP so the 80/443 IP doesn't conflict with the opnsense interface. I set up a VIP and when I went to the adguard home setup port [3000] it doesn't show a bind interface of the VIP. Is there a way to expose the VIP to adguard home? Or would I have to do this in the shell after the intial configuration?

Thanks for your help

reddit.com
u/redditphantom — 1 day ago

Inventory Chicken and Egg Problem

I am hoping someone can point me in the right direction here as I am not seeing a way to accomplish my desired outcome. I am creating a playbook that will create a new VM in proxmox. I then want to execute a task on said VM as part of the configuration. So I can create the VM but how do I execute my tasks on this VM when it isn't in the inventory to be executed on. I cannot declare the new VM in hosts and use limits to specify which host this applies to as the server isn't created yet and I don't have the required information to connect to it until it is created.

I am sure someone out there has got past this so I am hoping you can guide me to a solution to this problem without having to run a separate playbook after the fact.

The main task I am trying to do after it is deployed is join my server to a FreeIPA server but I am sure there will be other tasks as part of the preparation of the server.

reddit.com
u/redditphantom — 7 days ago
▲ 24 r/ansible+1 crossposts

Understanding Ansible creation of VM

So I have been experimenting with Ansible and creating a new VM and I have been successful but I want to take it to the next level by using cloud-init. I am able to get a cloud-init and template setup and clone from within proxmox. My issue is that I am confused by the method through proxmox and the community.proxmox.proxmox_kvm module. In the documentation it seems to indicate in the example to create a new VM and attach the cloud-init image to that VM for initialization of the VM.

- name: Create new VM using Cloud-Init with an ssh key
  community.proxmox.proxmox_kvm:
    node: sabrewulf
    api_user: root@pam
    api_password: secret
    api_host: helldorado
    name: spynal
    ide:
      ide2: 'local:cloudinit,format=qcow2'
    sshkeys: |
      ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPUF/cMCRObddaMmvUDio//yge6gRGXNv3uqMq7ve0x3 ssh-key-1@example.com
      ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIP+v9HERWdWKh1lxceobl98LBX3+alfVK0zJnAxLbMRq ssh-key-2@example.com
    searchdomains: 'mydomain.internal'
    nameservers:
      - '1.1.1.1'
      - '8.8.8.8'
    net:
      net0: 'virtio,bridge=vmbr1,tag=77'
    ipconfig:
      ipconfig0: 'ip=192.168.1.1/24'

However other examples show cloning a template with cloud-init attached to the template:

  - name: Clone cloud-init template
    community.general.proxmox_kvm:
      node: proxmox
      vmid: 9000
      clone: gemini
      name: cloud-1
      api_user: ansible@pam
      api_token_id: ansible_pve_token
      api_token_secret: 1daf3b05-5f94-4f10-b924-888ba30b038b
      api_host: your.proxmox.host
      storage: ZFS01
      timeout: 90

I don't know if there is a method that is considered best practice or if there is an advantage of one over the other. The creating a VM from scratch (Edit: using Ansible to create the VM and attaching the cloud init image, I think I confused people by saying from scratch) seems better to me as you don't have to store a template around. Maybe I am missing something but is there a best practice here? It gets confusing when I see different ways of doing what appears the same thing but nobody documenting what is the best option. Thanks in advance for your guidance.

EDIT: Ok so I figured out what I needed. I found information on this from some of the people posting here as well as the following sites below. It seems a minimal template is required to hold the cloud-init image being stored in relation to the template. You have to then import that image to your newly created VM and boot it and it will deploy with what you set in your ansible script. Thank you all.

https://joshrnoll.com/deploying-proxmox-vms-with-ansible-part-2/

https://www.uncommonengineer.com/docs/engineer/LAB/proxmox-cloudinit/

reddit.com
u/redditphantom — 11 days ago