XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Sorting out APIs and Ansible Modules

    Scheduled Pinned Locked Moved REST API
    7 Posts 2 Posters 545 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      hcoles
      last edited by

      The Ansible docs from here: https://docs.ansible.com/ansible/latest/collections/community/general/xenserver_guest_module.html
      Seem to indicate the host is the XCP server, not XO, and differ from the blog I found here:
      https://xen-orchestra.com/blog/virtops3-ansible-with-xen-orchestra/ (which appears to have quit a bit of age on it now)..

      The problem is we're trying to POC Ansible automation in deploying and Decommissioning VMs but we're having trouble authenticating. The question is: For Ansible, does it use a connection directly to the Master Hypervisor, (XCP Server) or to XO?

      It appears the XENAPI is more complete as well, but looks like connection to the XCP server is necessary for that.

      Any removal of the fog on my end would be appreciated, as I don't profess to be an API or Ansible expert.

      H 1 Reply Last reply Reply Quote 0
      • H Offline
        hcoles @hcoles
        last edited by

        @hcoles I did find that in the first set of docs it points to xenserver or XCP host.

        That said, how would I setup an account to be used for the purpose so that we're not using "root" as that would flag on audits.

        1 Reply Last reply Reply Quote 0
        • olivierlambertO Offline
          olivierlambert Vates 🪐 Co-Founder CEO
          last edited by olivierlambert

          Hi,

          The xenserver ansible module isn't what you seek. It's better to use XO modules, as it's the central point and a lot safer to use at scale than storing all XCP-ng creds for all your hosts.

          If there's missing bits in the providers you need, we'll be happy to help you contribute (ie doing issues and explain what's missing and even maybe if you can improve it directly via a pull request)

          edit: the first link you posted is for XenServer, not XCP-ng 😉

          H 1 Reply Last reply Reply Quote 0
          • H Offline
            hcoles @olivierlambert
            last edited by

            @olivierlambert That module/plugin looks to only be for inventory, I need to be able to deploy VMs, decom, modify, etc. Did I miss something in the docs?

            I'm not a developer, and I need to find a way to use Ansible to automate VM setup and take down. We're currently in POC mode for XCP, but we're finding it coming up short in Automation (or docs about it).

            The xenserver one is documented to be tested with XCP, and was I was directed to when searching for what I need.

            1 Reply Last reply Reply Quote 0
            • olivierlambertO Offline
              olivierlambert Vates 🪐 Co-Founder CEO
              last edited by

              For now, this is done with Packer+Terraform. We have plans to do also the same for Ansible (which is indeed only inventory for now).

              You can use the XS ansible module, but it is not maintained. Maybe that would be enough until we got the module for XO API 🙂

              H 1 Reply Last reply Reply Quote 0
              • H Offline
                hcoles @olivierlambert
                last edited by

                @olivierlambert Well, Thanks for the info, we'll have to look into that.
                Terraform can use templates as well right? So, if we don't use packer for VMs we wouldn't necessarily have to in the future?

                1 Reply Last reply Reply Quote 0
                • olivierlambertO Offline
                  olivierlambert Vates 🪐 Co-Founder CEO
                  last edited by

                  Yes, you can use Terraform directly 🙂

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post