Giter Club home page Giter Club logo

jarbas's Introduction

jarbas

A rather opinionated cookbook to provision and configure workstations

Pre-requisites

  • git: To checkout the repo
  • chef-workstation: Need chef-client and chef

How to use

Run the converge script to execute the entire setup

$ ./bin/converge.sh

Named run lists can be executed by passing the name as the first positional parameter

$ ./bin/converge.sh aws

After the first setup, converge.sh is aliased to j, so the above can be used as

$ j aws

Custom attributes

Node attributes are set on ${HOME}/.jarbas.json. This file will be created on the first run if not found.

To run additional recipes override jarbas['recipes'] with a list of any recipes you want to run on the node.

Testing

Unit

RSpec is used for unit tests.

$ chef exec rspec

Integration

Test kitchen is used for integration tests.

$ kitchen test

jarbas's People

Contributors

nvnivs avatar renovate[bot] avatar

Watchers

James Cloos avatar

jarbas's Issues

[ruby]: RVM installation fails

    Mixlib::ShellOut::ShellCommandFailed
    ------------------------------------
    execute[install_gpg_key[0x409B6B1796C275462A1703113804BB82D39DC0E3]] (jarbas::ruby line 6) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '2'
    ---- Begin output of gpg2 --keyserver hkp://pool.sks-keyservers.net --recv-keys 0x409B6B1796C275462A1703113804BB82D39DC0E3 ----
    STDOUT: 
    STDERR: gpg: keyserver receive failed: Server indicated a failure
    ---- End output of gpg2 --keyserver hkp://pool.sks-keyservers.net --recv-keys 0x409B6B1796C275462A1703113804BB82D39DC0E3 ----
    Ran gpg2 --keyserver hkp://pool.sks-keyservers.net --recv-keys 0x409B6B1796C275462A1703113804BB82D39DC0E3 returned 2

[kitchen]: Support OSX

Using sickcodes/docker-osx do run osx integration tests with the following configuration on platform in kitchen.yaml:

  - name: osx
    driver:
      image: sickcodes/docker-osx

Fails to converge:

    System Info:
    ------------
    chef_version=15.17.4
    platform=arch
    platform_version=5.13.13-1-MANJARO
    ruby=ruby 2.6.7p197 (2021-04-05 revision 67941) [x86_64-linux]
    program_name=/opt/chef/bin/chef-client
    executable=/opt/chef/bin/chef-client
    

Running handlers:
[2022-02-12T08:33:26+00:00] ERROR: Running exception handlers
Running handlers complete
[2022-02-12T08:33:26+00:00] ERROR: Exception handlers complete
Chef Infra Client failed. 0 resources updated in 01 seconds
[2022-02-12T08:33:26+00:00] FATAL: Stacktrace dumped to /opt/kitchen/cache/chef-stacktrace.out
[2022-02-12T08:33:26+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2022-02-12T08:33:26+00:00] FATAL: Mixlib::ShellOut::ShellCommandFailed: execute[Pacman update] (jarbas::platform_arch line 7) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of pacman -Syyu --noconfirm ----
STDOUT: 
STDERR: error: you cannot perform this operation unless you are root.
---- End output of pacman -Syyu --noconfirm ----
Ran pacman -Syyu --noconfirm returned 1
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>>     Converge failed on instance <default-osx>.  Please see .kitchen/logs/default-osx.log for more details
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

Docker imaged based on https://github.com/sickcodes/Docker-OSX

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/ci.yml
  • actions/checkout v4
  • ruby/setup-ruby v1
  • actions/checkout v4
  • ruby/setup-ruby v1
  • actions/checkout v4
  • actionshub/chef-install 3.0.0
  • actionshub/test-kitchen 2.1.0
  • actions/checkout v4
  • actionshub/chef-install 3.0.0
regex
metadata.rb
  • sous-chefs/homebrew 5.4.5
  • microsoft/macos-cookbook 5.1.0
  • sous-chefs/vagrant 4.0.15

  • Check this box to trigger a request for Renovate to run again on this repository

Run add-hoc recipes

With the move to Policyfile the ability of overridding a run list has been lost has it's not supported by older versions of chef-client, such as 15.14.0 on Arch based systems.

Look into named_run_list as a possible alternative:

https://docs.chef.io/config_rb_policyfile/

named_run_list "NAME", "ITEM1", "ITEM2", ...
Specify a named run-list to be used as an alternative to the override run-list. This setting should be used carefully and for specific use cases, like running a small set of recipes to quickly converge configuration for a single application on a host or for one-time setup tasks. For example:

Copy
named_run_list :update_app, 'my_app_cookbook::default'

Guard on Pacman update and clean

Pacman is always executing on update and clean for arch platform

Recipe: jarbas::pre_platform_arch
  * execute[Pacman update] action run
    [execute] :: Synchronizing package databases...
               core downloading...
               extra downloading...
               community downloading...
               multilib downloading...
              :: Starting full system upgrade...
              warning: python-pyqt5: local (5.15.6-7.1) is newer than extra (5.15.6-7)
               there is nothing to do
    - execute pacman -Syyu --noconfirm
Recipe: jarbas::post_platform_arch
  * execute[Pacman clean] action run
    [execute] Packages to keep:
                All locally installed packages
              
              Cache directory: /var/cache/pacman/pkg/
              :: Do you want to remove all other packages from cache? [Y/n] 
              removing old packages from cache...
              
              Database directory: /var/lib/pacman/
              :: Do you want to remove unused repositories? [Y/n] 
              removing unused sync repositories...
    - execute pacman -Sc --noconfirm

Guard on yay update and clean

Yay resource is always executing on update and clean for arch platform

  * execute[Yay update] action run
    [execute]  -> Avoid running yay as root/sudo.
              :: Synchronizing package databases...
               core downloading...
               extra downloading...
               community downloading...
               multilib downloading...
              :: Starting full system upgrade...
              warning: python-pyqt5: local (5.15.6-7.1) is newer than extra (5.15.6-7)
               there is nothing to do
              :: Searching databases for updates...
              :: Searching AUR for updates...
               -> python-pyqt5: local (5.15.6-7.1) is newer than extra (5.15.6-7)
               -> Missing AUR Packages:  linux513  vertex-maia-themes
               there is nothing to do
    - execute yay -Syu --builddir=/tmp/ --noconfirm
  * execute[Yay clean] action run
    [execute]  -> Avoid running yay as root/sudo.
              Packages to keep:
                All locally installed packages
              
              Cache directory: /var/cache/pacman/pkg/
              :: Do you want to remove all other packages from cache? [Y/n] 
              removing old packages from cache...
              
              Database directory: /var/lib/pacman/
              :: Do you want to remove unused repositories? [Y/n] 
              removing unused sync repositories...
              
              Build directory: /tmp/yay
              removing AUR packages from cache...
              removing untracked AUR files from cache...
    - execute yay -Sc --noconfirm

post_platform_mac_os_x: brew upgrade guard preventing brew package upgrade

Recipe: jarbas::post_platform_mac_os_x
  * jarbas_execute[softwareupdate] action run (skipped due to not_if)
  * jarbas_execute[brew upgrade] action run (skipped due to not_if)
$ brew outdated
gh (2.5.1) < 2.6.0
glib (2.70.4) < 2.72.0
gnutls (3.7.3) < 3.7.4
go (1.17.6) < 1.18
helm (3.8.0) < 3.8.1
icu4c (69.1) < 70.1
kubernetes-cli (1.23.4) < 1.23.5
libnghttp2 (1.46.0) < 1.47.0
libtool (2.4.6_4) < 2.4.7
libuv (1.43.0) < 1.44.1
lua (5.4.4) < 5.4.4_1
node (17.6.0) < 17.8.0
openssl@3 (3.0.1) < 3.0.2
packer (1.7.10) < 1.8.0
pipenv (2022.1.8) < 2022.3.24
qemu (6.2.0) < 6.2.0_1
sops (3.7.1) < 3.7.2
terragrunt (0.36.2) < 0.36.6
typescript (4.6.2) < 4.6.3
vim (8.2.4450) < 8.2.4600
watch (3.3.17) < 4.0.0
yarn (1.22.17_2) < 1.22.18

Guards not working for pip install on `arch` platform

  * jarbas_execute[pip_package[pytest]] action run
    * execute[pip_package[pytest]] action run
      - execute pip3 install pytest
  
  * jarbas_execute[pip_package[tox]] action run
    * execute[pip_package[tox]] action run
      - execute pip3 install tox

Terrafrom: GoDaddy plugin installation no longer supported

Resource is running with every execution:

  * jarbas_execute[terraform_plugin[godaddy]] action run
    * execute[terraform_plugin[godaddy]] action run
      - execute curl -s https://raw.githubusercontent.com/n3integration/terraform-godaddy/master/install.sh |bash -

Executing the script warn with exit 0 and no changes

$ curl -s https://raw.githubusercontent.com/n3integration/terraform-godaddy/master/install.sh |bash -
Warning: installation script no longer supported

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.