Просмотр исходного кода

feat(podman): Add podman cookbook

Signed-off-by: Jeremy MAURO <jeremy.mauro@gmail.com>
Jeremy MAURO 2 лет назад
Родитель
Сommit
64a7232237

+ 25 - 0
cookbooks/podman/.gitignore

@@ -0,0 +1,25 @@
+.vagrant
+*~
+*#
+.#*
+\#*#
+.*.sw[a-z]
+*.un~
+
+# Bundler
+Gemfile.lock
+gems.locked
+bin/*
+.bundle/*
+
+# test kitchen
+.kitchen/
+kitchen.local.yml
+
+# Chef Infra
+Berksfile.lock
+.zero-knife.rb
+Policyfile.lock.json
+
+.idea/
+

+ 10 - 0
cookbooks/podman/CHANGELOG.md

@@ -0,0 +1,10 @@
+# podman CHANGELOG
+
+This file is used to list changes made in each version of the podman cookbook.
+
+## 0.1.0
+
+Initial release.
+
+- change 0
+- change 1

+ 3 - 0
cookbooks/podman/LICENSE

@@ -0,0 +1,3 @@
+Copyright 2022 The Authors
+
+All rights reserved, do not redistribute.

+ 4 - 0
cookbooks/podman/README.md

@@ -0,0 +1,4 @@
+# podman
+
+TODO: Enter the cookbook description here.
+

+ 115 - 0
cookbooks/podman/chefignore

@@ -0,0 +1,115 @@
+# Put files/directories that should be ignored in this file when uploading
+# to a Chef Infra Server or Supermarket.
+# Lines that start with '# ' are comments.
+
+# OS generated files #
+######################
+.DS_Store
+ehthumbs.db
+Icon?
+nohup.out
+Thumbs.db
+.envrc
+
+# EDITORS #
+###########
+.#*
+.project
+.settings
+*_flymake
+*_flymake.*
+*.bak
+*.sw[a-z]
+*.tmproj
+*~
+\#*
+REVISION
+TAGS*
+tmtags
+.vscode
+.editorconfig
+
+## COMPILED ##
+##############
+*.class
+*.com
+*.dll
+*.exe
+*.o
+*.pyc
+*.so
+*/rdoc/
+a.out
+mkmf.log
+
+# Testing #
+###########
+.circleci/*
+.codeclimate.yml
+.delivery/*
+.foodcritic
+.kitchen*
+.mdlrc
+.overcommit.yml
+.rspec
+.rubocop.yml
+.travis.yml
+.watchr
+.yamllint
+azure-pipelines.yml
+Dangerfile
+examples/*
+features/*
+Guardfile
+kitchen.yml*
+mlc_config.json
+Procfile
+Rakefile
+spec/*
+test/*
+
+# SCM #
+#######
+.git
+.gitattributes
+.gitconfig
+.github/*
+.gitignore
+.gitkeep
+.gitmodules
+.svn
+*/.bzr/*
+*/.git
+*/.hg/*
+*/.svn/*
+
+# Berkshelf #
+#############
+Berksfile
+Berksfile.lock
+cookbooks/*
+tmp
+
+# Bundler #
+###########
+vendor/*
+Gemfile
+Gemfile.lock
+
+# Policyfile #
+##############
+Policyfile.rb
+Policyfile.lock.json
+
+# Documentation #
+#############
+CODE_OF_CONDUCT*
+CONTRIBUTING*
+documentation/*
+TESTING*
+UPGRADING*
+
+# Vagrant #
+###########
+.vagrant
+Vagrantfile

+ 25 - 0
cookbooks/podman/compliance/README.md

@@ -0,0 +1,25 @@
+# compliance
+
+This directory contains Chef InSpec profile, waiver and input objects which are used with the Chef Infra Compliance Phase.
+
+Detailed information on the Chef Infra Compliance Phase can be found in the [Chef Documentation](https://docs.chef.io/chef_compliance_phase/).
+
+```plain
+./compliance
+├── inputs
+├── profiles
+└── waivers
+```
+
+Use the `chef generate` command from Chef Workstation to create content for these directories:
+
+```sh
+# Generate a Chef InSpec profile
+chef generate profile PROFILE_NAME
+
+# Generate a Chef InSpec waiver file
+chef generate waiver WAIVER_NAME
+
+# Generate a Chef InSpec input file
+chef generate input INPUT_NAME
+```

+ 31 - 0
cookbooks/podman/kitchen.yml

@@ -0,0 +1,31 @@
+---
+driver:
+  name: vagrant
+
+## The forwarded_port port feature lets you connect to ports on the VM guest
+## via localhost on the host.
+## see also: https://www.vagrantup.com/docs/networking/forwarded_ports
+
+#  network:
+#    - ["forwarded_port", {guest: 80, host: 8080}]
+
+provisioner:
+  name: chef_zero
+
+  ## product_name and product_version specifies a specific Chef product and version to install.
+  ## see the Chef documentation for more details: https://docs.chef.io/workstation/config_yml_kitchen/
+  #  product_name: chef
+  #  product_version: 17
+
+verifier:
+  name: inspec
+
+platforms:
+  - name: ubuntu-20.04
+  - name: centos-8
+
+suites:
+  - name: default
+    verifier:
+      inspec_tests:
+        - test/integration/default

+ 19 - 0
cookbooks/podman/metadata.rb

@@ -0,0 +1,19 @@
+name 'podman'
+maintainer 'The Authors'
+maintainer_email 'you@example.com'
+license 'All Rights Reserved'
+description 'Installs/Configures podman'
+version '0.1.0'
+chef_version '>= 16.0'
+
+# The `issues_url` points to the location where issues for this cookbook are
+# tracked.  A `View Issues` link will be displayed on this cookbook's page when
+# uploaded to a Supermarket.
+#
+# issues_url 'https://github.com/<insert_org_here>/podman/issues'
+
+# The `source_url` points to the development repository for this cookbook.  A
+# `View Source` link will be displayed on this cookbook's page when uploaded to
+# a Supermarket.
+#
+# source_url 'https://github.com/<insert_org_here>/podman'

+ 5 - 0
cookbooks/podman/recipes/default.rb

@@ -0,0 +1,5 @@
+#
+# Cookbook:: podman
+# Recipe:: default
+#
+# Copyright:: 2022, The Authors, All Rights Reserved.

+ 16 - 0
cookbooks/podman/test/integration/default/default_test.rb

@@ -0,0 +1,16 @@
+# Chef InSpec test for recipe podman::default
+
+# The Chef InSpec reference, with examples and extensive documentation, can be
+# found at https://docs.chef.io/inspec/resources/
+
+unless os.windows?
+  # This is an example test, replace with your own test.
+  describe user('root'), :skip do
+    it { should exist }
+  end
+end
+
+# This is an example test, replace it with your own test.
+describe port(80), :skip do
+  it { should_not be_listening }
+end