Quantcast
Viewing all articles
Browse latest Browse all 171015

Prox - Ansible - Changing Configuration

Building on past experience and using previously created playbooks, with Ansible (version 1.1) we've (really my devops partner) created a process that creates containers from defined settings - template, ram, disk size, etc.

We do this by calling pvesh like so

Code:

pvesh create /nodes/${target_env}-proxmox-${node_id}/openvz -vmid ${vm_id} -ostemplate ${container.ostemplate} -memory ${container.memory) (etc)
This is really handy for deploying X containers at a time, and doing so without making any tedious mistakes in configuration.

What I'd like to do is change a given container's (ram, disk size, network configuration) by changing it's configuration file. Ansible would execute playbook at defined intervals, notice that ${container.memory} is different than the actual value that container has, and adjust.

This is better for operations in that one needs only touch a configuration once, it's under change control, and changes happen, rather than reaching out and manually adding that value.

I am probably missing something, but the only way I can see to do this is like so

- process pulls the configuration for container X
- if variables diff then execute change
- else exit 0.

Comments? It's not impossible that the prox API provides a way to make that happen without a lot of extracting and comparing variables in bash or perl and I'm missing it.

Viewing all articles
Browse latest Browse all 171015

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>