-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
proxmox lxc - allow update of existing containers #1278
Comments
Files identified in the description: If these files are inaccurate, please update the |
Files identified in the description: If these files are inaccurate, please update the |
cc @Aversiste @timothyvandenbrande @joshainglis @karmab |
This is actually harder than it looks as a careless update will destroy and recreate the network devices instead of updating them. I am working on this problem for |
Files identified in the description:
If these files are incorrect, please update the |
Files identified in the description:
If these files are incorrect, please update the |
This seems to be somewhat fixed by #7540. You can now provide a I tried reducing duplicated code by using YAML Anchor like so: - name: Create LXC Container (if missing)
community.general.proxmox: &container
# proxmox api
api_host: "{{ ansible_host }}"
api_user: root@pam
api_password: "{{ (admins | combine(users | default({}), recursive=true))['root']['password'] }}"
node: "{{ ansible_hostname }}"
# lxc config
hostname: "{{ item.hostname }}"
vmid: "{{ item.vmid }}"
memory: "{{ item.memory }}"
cpus: "{{ item.cpus }}"
netif: "{{ item.netif | to_json }}"
# static stuff
swap: 0
password: "{{ lxc_password }}"
ostemplate: "{{ lxc_template_storage }}:{{ lxc_template_path }}/{{ item.template }}"
pubkey: "{{ (admins | combine(users | default({}), recursive=true))['root']['sshpubkey'] }}"
loop: "{{ lxc }}"
- name: Update LXC container
community.general.proxmox:
<<: *container
state: "{{ item.state | default('started') }}"
ostemplate: null
update: true
loop: "{{ lxc }}" But this doesn't work since It would be cool if the module ignored |
SUMMARY
Allow to update existing containers.
ISSUE TYPE
COMPONENT NAME
proxmox
ADDITIONAL INFORMATION
When managing lxc-containers on proxmox from ansible, it is currently not possible to update these containers, e.g. change the ip-address etc. This would be a really good addition, since it is currently needed to update this at multiple places: the playbook and proxmox itself.
The text was updated successfully, but these errors were encountered: