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

    Ansible and XCP-ng

    Scheduled Pinned Locked Moved Development
    12 Posts 5 Posters 4.2k 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.
    • C Offline
      cheese @ruskofd
      last edited by

      @Ruskofff There are already some modules about XenServer within Ansibe sources. Just find 'xenserver'. I hope you can use them as start point.

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

        I would suggest terraform on xo-cli or XO API (easier to have one entry point for the whole infrastructure, means less work on the layer on top)

        1 Reply Last reply Reply Quote 0
        • ruskofdR Offline
          ruskofd
          last edited by

          I already check xenserver with Ansible and I didn't find some things that seems up to date. And I agree with Olivier, I would like to query directly XO than the XAPI.

          These are idea for Ansible playbook in the first time, I need to learn Go and Python from scratch before thinking create some modules.

          1 Reply Last reply Reply Quote 0
          • ruskofdR Offline
            ruskofd
            last edited by ruskofd

            Edit : I found the Ansible module you talking about @cheese (with the other topic talking about Ansible on XenServer). I could start from this point for the deployment of VM yes. Seems good for me !

            Concerning Terraform, I check some code source on Github with the official documentation from Hashicorp, I need much more time to understand everything... I need more development practice 😧

            But for now, I will fully focus on Ansible.

            B 1 Reply Last reply Reply Quote 0
            • B Offline
              bvitnik @ruskofd
              last edited by

              @Ruskofff said in Ansible and XCP-ng:

              Edit : I found the Ansible module you talking about @cheese (with the other topic talking about Ansible on XenServer). I could start from this point for the deployment of VM yes. Seems good for me !

              This is the thread:

              https://xcp-ng.org/forum/topic/159/deploy-vms-using-ansible

              I'm the author of the module. The thread is a little outdated but I will update it ASAP. Feel free to ask me anything regarding the module.

              1 Reply Last reply Reply Quote 1
              • ruskofdR Offline
                ruskofd
                last edited by

                Indeed, this is this one ! I will check your module to see what can it bring to me. I already tried with the XAPI how can I do certain things for the first idea that I posted above, I will check later how can I do that with your module.

                B 1 Reply Last reply Reply Quote 0
                • B Offline
                  bvitnik @ruskofd
                  last edited by

                  @Ruskofff I've updated the thread with new info regarding my modules.

                  The biggest advantage to using the modules instead of using xe tool or calling XAPI methods is that modules follow Ansible's idempotency principle. So you can run your Ansible playbooks multiple times without worrying that Ansible will do anything more times than expected.

                  1 Reply Last reply Reply Quote 0
                  • N Offline
                    nhanlon
                    last edited by

                    This thread reminds me I should think about open sourcing our ruby implementation of the XO API...

                    1 Reply Last reply Reply Quote 0
                    • ruskofdR Offline
                      ruskofd
                      last edited by ruskofd

                      @bvitnik I propose to put your explanation of the other topic to the XCP-ng wiki, it could be very useful for everyone who want to use the module.

                      The link : https://github.com/xcp-ng/xcp/wiki

                      I have a question about your module "xenserver_guest". Is it able to modify settings of the VM ? My main interest will be to mount the guest-tools.iso file to the VM. It's easy with the xe cli but I can't test it now that why I'm asking this.

                      B 1 Reply Last reply Reply Quote 0
                      • B Offline
                        bvitnik @ruskofd
                        last edited by bvitnik

                        @Ruskofff said in Ansible and XCP-ng:

                        I have a question about your module "xenserver_guest". Is it able to modify settings of the VM ? My main interest will be to mount the guest-tools.iso file to the VM. It's easy with the xe cli but I can't test it now that why I'm asking this.

                        Of course. Check out "cdrom" module parameter in the docs.

                        1 Reply Last reply Reply Quote 0
                        • ruskofdR Offline
                          ruskofd
                          last edited by

                          Perfect ! I was thinking that is only available during the deployment of a VM (I need more experience on Ansible 😂)

                          I will give a try as soon as I get the possibility to use Ansible.

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