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

Merge mcollective choria #88

Merged
merged 753 commits into from
Dec 28, 2020

Conversation

ripienaar
Copy link
Member

No description provided.

ripienaar and others added 30 commits March 8, 2018 21:00
In Puppet this won't work, we will need to look towards one specific
to Puppet later that might replace this one
(#402) Remove the memory data store
(#423) Remove the federation observe command
(#431) Update nats-pure dependency to 0.4.0
(#434) fix dependency handling on Archlinux
This uses Puppet to validate the input given on the CLI against the
task specification, input from json/yaml files are combined with the
options given on the CLI

This is only half the story, we must do validation on the nodes as well
but right now the nodes do not get the full task metadata only the files
spec, this is the mechanism that creates a specific predictable set of
executables being run and fetching the metadata from the server would be
open to a time based race

But sending the metadata to validate against to the server provides no
security, so perhaps this is fine, need to think some more, but for now
we have quick client side failure on input validation errors
(#347) validate input given on the client before making the request
(#347) fix call to validate inputs
(#347) improve handling of boolean inputs
(#347) Add a basic task to assist with testing the functionality
(#347) rename module for consistency and to fix AAA
(#448) Remove the Ruby Federation Broker
(#430) use https for the choria icon on slack
(#448) remove federation files from the module
4222 appears throughout the code, however this one line shows four twos instead of three twos ( 42222 ). Simple fix.
…cal-Correction

Default middleware port is incorrectly set to 42222
This adds --foo and --no-foo as options for booleans, previously
it only have --foo which was not very useful
ripienaar and others added 26 commits July 17, 2020 12:06
Signed-off-by: R.I.Pienaar <[email protected]>
(#628) copy scout ddl files
(#634) Support JWT based anonymous broker tls
MCollective is being replaced with Choria.  The mcollective::service
class was used to know if a node was configured with MCollective or not.

Now that the service is being removed from the MCollective class, we
need to check for the equivalent class in the choria module,
choria::service.

For now, look for any of those two classes, so that legacy nodes not
using Choria can continue to behave as previously.
Build with:
```
cd spec/fixtures/ && make
```
(#638) Allow discovery with choria::service
this prepares to merge this code into mcorpc support

Signed-off-by: R.I.Pienaar <[email protected]>
Older versions of etcdv3 do not support up-to-date versions of Ruby.
Relax the version requirements to allow running the code with recent
Ruby.
The OpenSSL::SSL::SSLContext#cert and OpenSSL::SSL::SSLContext#key
method seems to always return nil with Ruby 2.6.

These method are deprecated, so maybe we can totaly get rid of them.

https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL/SSLContext.html#cert-attribute-method
The original filename is used to build the spool hierarchy so given the
following specification:

```
[
  {
    "filename": "database_delete.sh",
    "sha256": "27cf85fc65b33bd3492e0188533d4a25d67cd810d91f61b4baf6e89cc675539a",
    "size_bytes": 140,
    "uri": {
      "path": "/puppet/v3/static_file_content/modules/odoo/tasks/database_delete.sh",
      "params": {
        "environment": "production",
        "code_id": "cf812ee55e84bf63a0b8ee4a08b2c3fad26dc313"
      }
    }
  },
  {
    "filename": "odoo/files/database-delete.py",
    "sha256": "deffdfa89fac5e02d689d26ae43c933e47cb10ea12d56dd6c72184043bc56f25",
    "size_bytes": 96,
    "uri": {
      "path": "/puppet/v3/static_file_content/modules/odoo/files/database-delete.py",
      "params": {
        "environment": "production",
        "code_id": "cf812ee55e84bf63a0b8ee4a08b2c3fad26dc313"
      }
    }
  }
]
```

we end-up with the following hierarchy of files in the spool directory:

```
<spool-directory>
|-> choria.json
|-> exitcode
|-> files
|   |-> database_delete.sh
|   `-> odoo
|       `-> files
|           `-> database-delete.py
|-> stderr
|-> stdout
|-> wrapper_pid
|-> wrapper_stderr
|-> wrapper_stdin
`-> wrapper_stdout
```
Store each cached file in a single directory using the file checksum as
filename.  That was, if two tasks distribute a file with the exact same
content, it is storred only once on disk in the cache directory.

The original filename is used to build the spool hierarchy so given the
following specification:

```
[
  {
    "filename": "database_delete.sh",
    "sha256": "27cf85fc65b33bd3492e0188533d4a25d67cd810d91f61b4baf6e89cc675539a",
    "size_bytes": 140,
    "uri": {
      "path": "/puppet/v3/static_file_content/modules/odoo/tasks/database_delete.sh",
      "params": {
        "environment": "production",
        "code_id": "cf812ee55e84bf63a0b8ee4a08b2c3fad26dc313"
      }
    }
  },
  {
    "filename": "odoo/files/database-delete.py",
    "sha256": "deffdfa89fac5e02d689d26ae43c933e47cb10ea12d56dd6c72184043bc56f25",
    "size_bytes": 96,
    "uri": {
      "path": "/puppet/v3/static_file_content/modules/odoo/files/database-delete.py",
      "params": {
        "environment": "production",
        "code_id": "cf812ee55e84bf63a0b8ee4a08b2c3fad26dc313"
      }
    }
  }
]
```

we end-up with the following hierarchy of files in the cache:

```
<cache-directory>
|-> 27cf85fc65b33bd3492e0188533d4a25d67cd810d91f61b4baf6e89cc675539a
`-> deffdfa89fac5e02d689d26ae43c933e47cb10ea12d56dd6c72184043bc56f25
```
When Bolt run a task, _installdir is set to the directory where the task
files have been copied.  In our case, we build a simiar hierarchy in the
file directory under the task spool directory, so set this environment
variable accordingly.

https://puppet.com/docs/bolt/latest/writing_tasks.html#sharing-task-code
(#605) Unbreak bolt_task with multiple files
Cache private keys so that decoding password protected keys happen
only once in multi batch requests

Signed-off-by: R.I.Pienaar <[email protected]>
Signed-off-by: R.I.Pienaar <[email protected]>
@ripienaar ripienaar merged commit 36c4e45 into choria-io:master Dec 28, 2020
@ripienaar ripienaar deleted the merge_mcollective_choria branch December 28, 2020 14:21
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.

7 participants