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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,8 @@ Please note that resource name must be same as installed package name.

### Puppet tasks

The module has a puppet task that allows to run `yum update` or `yum upgrade`.
The module has a puppet task that allows to run `yum update` or `yum upgrade`. This task needs puppet agent installed on the remote.

Please refer to the [Bolt documentation](https://puppet.com/docs/bolt/latest/bolt.html) on how to execute a task.

```bash
Expand Down
8 changes: 7 additions & 1 deletion tasks/init.json
Original file line number Diff line number Diff line change
Expand Up @@ -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)

{
"name": "init.rb",
"requirements": ["puppet-agent"]
}
]
}