Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-55899

Jenkins CasC ec2 plugin configuration doesn't work

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      I'm trying to configure EC2 plugin but for some reason it doesn't work and the I can't see the new cloud after I'm running CasC

       

      Jenkins version:  2.154

      This is the content of the file that I'm running the CasC with:

      plugins:
        required:
          ec2: 1.40.1
        sites:
        - id: "default"
          url: "https://updates.jenkins.io/update-center.json"jenkins:
        agentProtocols:
          - "JNLP4-connect"
          - "Ping"
        clouds:
          - amazonEC2:
              cloudName: "ec2"
              instanceCapStr: 20
              region: "us-west-2"
              # this shouldn't be needed, since without explicit creds this should already be used
              # but let's be explicit to avoid issues.
              useInstanceProfileForCredentials: true
              # Reminder: the following key has multiple lines
              privateKey: "PRIVATE_KEY"
              templates:
                - description: "Auto configured EC2 Agent, yay again"
                  zone: "us-west-2"
                  ami: "ami-0c6bb742864ffa3f3"
                  labelString: "test yey"
                  type: "T2Xlarge"
                  securityGroups: "some-group"
                  remoteFS: "/home/ec2-user"
                  remoteAdmin: "ec2-user"
                  mode: "NORMAL"
        primaryView:
          all:
            name: "all"
        quietPeriod: 5
        scmCheckoutRetryCount: 0unclassified:
        location:
          url: "http://localhost:8080/"
      tool:
        git:
          installations:
          - home: "git"
            name: "Default"
        jdk:
          defaultProperties:
          - installSource:
              installers:
              - jdkInstaller:
                  acceptLicense: false
      

      But unfortunately after running - nothing happens :

       

      This is the log output of my master container:

      Jan 31, 2019 6:01:56 PM io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator tryConstructor
      INFO: Setting class hudson.plugins.ec2.AmazonEC2Cloud.cloudName = ec2
      Jan 31, 2019 6:01:56 PM io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator tryConstructor
      INFO: Setting class hudson.plugins.ec2.AmazonEC2Cloud.useInstanceProfileForCredentials = true
      Jan 31, 2019 6:01:56 PM io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator tryConstructor
      INFO: Setting class hudson.plugins.ec2.AmazonEC2Cloud.region = us-west-2
      Jan 31, 2019 6:01:56 PM io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator tryConstructor
      INFO: Setting class hudson.plugins.ec2.AmazonEC2Cloud.privateKey = PRIVATE_KEY
      Jan 31, 2019 6:01:56 PM io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator tryConstructor
      INFO: Setting class hudson.plugins.ec2.AmazonEC2Cloud.instanceCapStr = 20
      Jan 31, 2019 6:01:56 PM io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator tryConstructor
      INFO: Setting class hudson.plugins.ec2.SlaveTemplate.ami = ami-0c6bb742864ffa3f3
      Jan 31, 2019 6:01:56 PM io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator tryConstructor
      INFO: Setting class hudson.plugins.ec2.SlaveTemplate.zone = us-west-2
      Jan 31, 2019 6:01:56 PM io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator tryConstructor
      INFO: Setting class hudson.plugins.ec2.SlaveTemplate.securityGroups = some-group
      Jan 31, 2019 6:01:56 PM io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator tryConstructor
      INFO: Setting class hudson.plugins.ec2.SlaveTemplate.remoteFS = /home/ec2-user
      Jan 31, 2019 6:01:56 PM io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator tryConstructor
      INFO: Setting class hudson.plugins.ec2.SlaveTemplate.type = T2Xlarge
      Jan 31, 2019 6:01:56 PM io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator tryConstructor
      INFO: Setting class hudson.plugins.ec2.SlaveTemplate.labelString = test yey
      Jan 31, 2019 6:01:56 PM io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator tryConstructor
      INFO: Setting class hudson.plugins.ec2.SlaveTemplate.mode = NORMAL
      Jan 31, 2019 6:01:56 PM io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator tryConstructor
      INFO: Setting class hudson.plugins.ec2.SlaveTemplate.description = Auto configured EC2 Agent, yay again
      Jan 31, 2019 6:01:56 PM io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator tryConstructor
      INFO: Setting class hudson.plugins.ec2.SlaveTemplate.remoteAdmin = ec2-user
      Jan 31, 2019 6:01:56 PM io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator tryConstructor
      INFO: Setting class hudson.plugins.ec2.AmazonEC2Cloud.templates = [{}]
      Jan 31, 2019 6:01:56 PM io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator tryConstructor
      INFO: Setting class hudson.model.AllView.name = all
      Jan 31, 2019 6:01:56 PM io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator tryConstructor
      INFO: Setting class hudson.tools.JDKInstaller.acceptLicense = false
      Jan 31, 2019 6:01:56 PM io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator tryConstructor
      INFO: Setting class hudson.tools.InstallSourceProperty.installers = [{jdkInstaller={}}]
      Jan 31, 2019 6:01:56 PM io.jenkins.plugins.casc.ConfigurationAsCode doReplace
      INFO: Provided sources could not be applied
      Jan 31, 2019 6:01:59 PM io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator tryConstructor
      INFO: Setting class hudson.plugins.ec2.AmazonEC2Cloud.cloudName = ec2
      Jan 31, 2019 6:01:59 PM io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator tryConstructor
      INFO: Setting class hudson.plugins.ec2.AmazonEC2Cloud.useInstanceProfileForCredentials = true
      Jan 31, 2019 6:01:59 PM io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator tryConstructor
      INFO: Setting class hudson.plugins.ec2.AmazonEC2Cloud.region = us-west-2
      Jan 31, 2019 6:01:59 PM io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator tryConstructor
      INFO: Setting class hudson.plugins.ec2.AmazonEC2Cloud.privateKey = PRIVATE_KEY
      Jan 31, 2019 6:01:59 PM io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator tryConstructor
      INFO: Setting class hudson.plugins.ec2.AmazonEC2Cloud.instanceCapStr = 20
      Jan 31, 2019 6:01:59 PM io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator tryConstructor
      INFO: Setting class hudson.plugins.ec2.SlaveTemplate.ami = ami-0c6bb742864ffa3f3
      Jan 31, 2019 6:01:59 PM io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator tryConstructor
      INFO: Setting class hudson.plugins.ec2.SlaveTemplate.zone = us-west-2
      Jan 31, 2019 6:01:59 PM io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator tryConstructor
      INFO: Setting class hudson.plugins.ec2.SlaveTemplate.securityGroups = some-group
      Jan 31, 2019 6:01:59 PM io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator tryConstructor
      INFO: Setting class hudson.plugins.ec2.SlaveTemplate.remoteFS = /home/ec2-user
      Jan 31, 2019 6:01:59 PM io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator tryConstructor
      INFO: Setting class hudson.plugins.ec2.SlaveTemplate.type = T2Xlarge
      Jan 31, 2019 6:01:59 PM io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator tryConstructor
      INFO: Setting class hudson.plugins.ec2.SlaveTemplate.labelString = test yey
      Jan 31, 2019 6:01:59 PM io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator tryConstructor
      INFO: Setting class hudson.plugins.ec2.SlaveTemplate.mode = NORMAL
      Jan 31, 2019 6:01:59 PM io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator tryConstructor
      INFO: Setting class hudson.plugins.ec2.SlaveTemplate.description = Auto configured EC2 Agent, yay again
      Jan 31, 2019 6:01:59 PM io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator tryConstructor
      INFO: Setting class hudson.plugins.ec2.SlaveTemplate.remoteAdmin = ec2-user
      Jan 31, 2019 6:01:59 PM io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator tryConstructor
      INFO: Setting class hudson.plugins.ec2.AmazonEC2Cloud.templates = [{}]
      Jan 31, 2019 6:01:59 PM io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator tryConstructor
      INFO: Setting class hudson.model.AllView.name = all
      Jan 31, 2019 6:01:59 PM io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator tryConstructor
      INFO: Setting class hudson.tools.JDKInstaller.acceptLicense = false
      Jan 31, 2019 6:01:59 PM io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator tryConstructor
      INFO: Setting class hudson.tools.InstallSourceProperty.installers = [{jdkInstaller={}}]
      

      Any idea?

       

      Thanks!

        Attachments

          Activity

          Hide
          gshefer Gilad Shefer added a comment -

          My bad. the problem was that other things were not been configured correctly and I didn't wait for the message "this config can be applied".

          Closing...

          Show
          gshefer Gilad Shefer added a comment - My bad. the problem was that other things were not been configured correctly and I didn't wait for the message "this config can be applied". Closing...

            People

            • Assignee:
              ewel Ewelina Wilkosz
              Reporter:
              gshefer Gilad Shefer
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: