Skip to content
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

add requirement expression in metadata of task #138

Merged
merged 1 commit into from
Jun 5, 2019

Conversation

Dan33l
Copy link
Member

@Dan33l Dan33l commented Jun 4, 2019

Pull Request (PR) descriptionly

The current task expect Puppet agent installed on the remote.

If it is missing on the remote we get the following error message :

 bolt task run yum action=update --nodes node1 --modulepath ./modules
Started on node1...
Failed on node1:
  The task failed with exit code 126:
  bash: /tmp/594417c7-c1ef-4956-b9ba-b07933580923/init.rb: /opt/puppetlabs/puppet/bin/ruby: bad interpreter: Aucun fichier ou dossier de ce type
 
  {
  }
Failed on 1 node: node1
Ran on 1 node in 0.81 seconds

This PR add the expression of the requirement in bolt. This should permit to get a nicer error message:

bolt task run yum action=update --nodes node1 --modulepath ./modules
Started on node1...
Failed on node1:
  No suitable implementation of yum for node1
Failed on 1 node: node1
Ran on 1 node in 0.15 seconds

@Dan33l Dan33l merged commit d55d957 into voxpupuli:master Jun 5, 2019
@Dan33l Dan33l deleted the task_work_only_with_puppetagent branch June 5, 2019 13:12
@@ -10,5 +10,11 @@
"description": "Run without output ",
"type": "Optional[Boolean]"
}
}
},
"implementations": [
Copy link
Member

@smortex smortex Jul 19, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is using 4 spaces for indentation while the rest of the file use 2 space indentation.

Also, with this change, I experience failures on code I am working on:

{
  "kind": "bolt/run-failure",
  "msg": "Plan aborted: run_task 'yum' failed on 2 nodes",
  "details": {
    "action": "run_task",
    "object": "yum",
    "result_set": [
      {
        "node": "aaa",
        "target": "aaa",
        "action": null,
        "object": null,
        "status": "failure",
        "result": {
          "_error": {
            "kind": "bolt/no-implementation",
            "msg": "No suitable implementation of yum for aaa",
            "details": {
            }
          }
        }
      },
      {
        "node": "bbb",
        "target": "bbb",
        "action": null,
        "object": null,
        "status": "failure",
        "result": {
          "_error": {
            "kind": "bolt/no-implementation",
            "msg": "No suitable implementation of yum for bbb",
            "details": {
            }
          }
        }
      }
    ]
  }
}

Reverting this change (or using the latest tagged version of the module, 4.0.0), fixes this issue:

[
  [
    {
      "node": "aaa",
      "target": "aaa",
      "action": "task",
      "object": "yum",
      "status": "success",
      "result": {
        "status": [
          {
            "package": "puppet-agent.x86_64",
            "available_version": "6.6.0-1.el7",
            "repository": "puppet6"
          }
        ]
      }
    },
    {
      "node": "bbb",
      "target": "bbb",
      "action": "task",
      "object": "yum",
      "status": "success",
      "result": {
        "status": [

        ]
      }
    }
  ]
]

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(This is CentOS installed with the AIO package, so I guess something is broken)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants