Prechádzať zdrojové kódy

feat(resolv_config): Extract resolv configuration

Signed-off-by: Jeremy MAURO <jeremy.mauro@gmail.com>
Jeremy MAURO 2 rokov pred
rodič
commit
ff5210e4e0

+ 36 - 10
base.lock.json

@@ -1,28 +1,28 @@
 {
-  "revision_id": "7ac42c3c88761da4874f1de2c39ed70fbf4d5d83dbe85ce3fda2bbe4b02797e9",
+  "revision_id": "38b7b72f1c06d71bfcffae37c29bf3d2be17ecc12f6d70e830fc98cdd089a6c4",
   "name": "base",
   "run_list": [
     "recipe[workstation::default]"
   ],
   "named_run_lists": {
     "complete": [
-      "recipe[workstation::_resolver]",
+      "recipe[resolver_config::_dokken]",
       "recipe[workstation::default]"
     ],
     "git": [
-      "recipe[workstation::_resolver]",
+      "recipe[resolver_config::_dokken]",
       "recipe[workstation::_git]"
     ],
     "apt": [
-      "recipe[workstation::_resolver]",
+      "recipe[resolver_config::_dokken]",
       "recipe[apt_repositories::_official]"
     ],
     "genie": [
-      "recipe[workstation::_resolver]",
+      "recipe[resolver_config::_dokken]",
       "recipe[workstation::_genie]"
     ],
     "packages": [
-      "recipe[workstation::_resolver]",
+      "recipe[resolver_config::_dokken]",
       "recipe[apt_repositories::_official]",
       "recipe[workstation::_packages]"
     ]
@@ -97,6 +97,26 @@
         "branch": "atomic_update"
       }
     },
+    "resolver_config": {
+      "version": "0.1.0",
+      "identifier": "f8b725c6551d308c809e72c8579c603c7534d9c8",
+      "dotted_decimal_identifier": "70007167093382448.39547914758412188.105812780702152",
+      "source": "cookbooks/resolver_config",
+      "cache_key": null,
+      "scm_info": {
+        "scm": "git",
+        "remote": null,
+        "revision": "1aca162ea4cb2b943587b0979149adcbe39ed382",
+        "working_tree_clean": false,
+        "published": false,
+        "synchronized_remote_branches": [
+
+        ]
+      },
+      "source_options": {
+        "path": "cookbooks/resolver_config"
+      }
+    },
     "seven_zip": {
       "version": "4.2.2",
       "identifier": "a97443e4baa8bb56ef7aef7e085c8985fafa8423",
@@ -165,6 +185,10 @@
         "resolver",
         ">= 0.0.0"
       ],
+      [
+        "resolver_config",
+        "= 0.1.0"
+      ],
       [
         "seven_zip",
         "= 4.2.2"
@@ -198,6 +222,12 @@
       ],
       "resolver (4.0.3)": [
 
+      ],
+      "resolver_config (0.1.0)": [
+        [
+          "resolver",
+          ">= 0.0.0"
+        ]
       ],
       "seven_zip (4.2.2)": [
 
@@ -211,10 +241,6 @@
           "git",
           ">= 0.0.0"
         ],
-        [
-          "resolver",
-          ">= 0.0.0"
-        ],
         [
           "apt_repositories",
           ">= 0.0.0"

+ 4 - 4
base.rb

@@ -17,21 +17,21 @@ run_list [
 
 # Kitchen-test suite
 named_run_list :complete, [
-  'workstation::_resolver',
+  'resolver_config::_dokken',
 ] + run_list
 
 named_run_list :git, [
-  'workstation::_resolver',
+  'resolver_config::_dokken',
   'workstation::_git',
 ]
 
 named_run_list :apt, [
-  'workstation::_resolver',
+  'resolver_config::_dokken',
   'apt_repositories::_official',
 ]
 
 named_run_list :genie, [
-  'workstation::_resolver',
+  'resolver_config::_dokken',
   'workstation::_genie',
 ]
 

+ 25 - 0
cookbooks/resolver_config/.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/resolver_config/CHANGELOG.md

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

+ 3 - 0
cookbooks/resolver_config/LICENSE

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

+ 16 - 0
cookbooks/resolver_config/Policyfile.rb

@@ -0,0 +1,16 @@
+# Policyfile.rb - Describe how you want Chef Infra Client to build your system.
+#
+# For more information on the Policyfile feature, visit
+# https://docs.chef.io/policyfile/
+
+# A name that describes what the system you're building with Chef does.
+name 'resolver_config'
+
+# Where to find external cookbooks:
+default_source :supermarket
+
+# run_list: chef-client will run these recipes in the order specified.
+run_list 'resolver_config::default'
+
+# Specify a custom source for a single cookbook:
+cookbook 'resolver_config', path: '.'

+ 4 - 0
cookbooks/resolver_config/README.md

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

+ 115 - 0
cookbooks/resolver_config/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/resolver_config/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/resolver_config/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

+ 20 - 0
cookbooks/resolver_config/metadata.rb

@@ -0,0 +1,20 @@
+name 'resolver_config'
+maintainer 'The Authors'
+maintainer_email 'you@example.com'
+license 'All Rights Reserved'
+description 'Installs/Configures resolver_config'
+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>/resolver_config/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>/resolver_config'
+depends 'resolver'

+ 2 - 2
cookbooks/workstation/recipes/_resolver.rb → cookbooks/resolver_config/recipes/_dokken.rb

@@ -1,6 +1,6 @@
 #
-# Cookbook:: workstation
-# Recipe:: _resolver
+# Cookbook:: revolv_config
+# Recipe:: _dokken
 #
 # Copyright:: 2022, The Authors, All Rights Reserved.
 

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

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

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

@@ -0,0 +1,16 @@
+# Chef InSpec test for recipe resolver_config::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

+ 0 - 1
cookbooks/workstation/metadata.rb

@@ -13,7 +13,6 @@ chef_version '>= 16.0'
 # issues_url 'https://github.com/<insert_org_here>/workstation/issues'
 depends 'etckeeper'
 depends 'git'
-depends 'resolver'
 depends 'apt_repositories'
 
 # The `source_url` points to the development repository for this cookbook.  A