├── .github
└── workflows
│ └── commitlint.yml
├── .gitignore
├── .gitlab-ci.yml
├── .pre-commit-config.yaml
├── .rstcheck.cfg
├── .rubocop.yml
├── .salt-lint
├── .travis.yml
├── .yamllint
├── AUTHORS.md
├── CHANGELOG.md
├── CODEOWNERS
├── FORMULA
├── Gemfile
├── Gemfile.lock
├── LICENSE
├── bin
└── kitchen
├── commitlint.config.js
├── docs
├── AUTHORS.rst
├── CHANGELOG.rst
├── CONTRIBUTING_DOCS.rst
├── README.rst
├── TOFS_pattern.rst
├── _static
│ └── css
│ │ └── custom.css
├── conf.py
├── index.rst
└── map.jinja.rst
├── kitchen.yml
├── kubernetes
├── clean.sls
├── client
│ ├── aliases
│ │ ├── clean.sls
│ │ ├── init.sls
│ │ └── install.sls
│ ├── alternatives
│ │ ├── clean.sls
│ │ ├── init.sls
│ │ └── install.sls
│ ├── archive
│ │ ├── clean.sls
│ │ ├── init.sls
│ │ └── install.sls
│ ├── binary
│ │ ├── clean.sls
│ │ ├── init.sls
│ │ └── install.sls
│ ├── clean.sls
│ ├── init.sls
│ └── package
│ │ ├── clean.sls
│ │ ├── init.sls
│ │ └── install.sls
├── cpuarchmap.yaml
├── crimgr
│ ├── alternatives
│ │ ├── clean.sls
│ │ ├── init.sls
│ │ └── install.sls
│ ├── archive
│ │ ├── clean.sls
│ │ ├── init.sls
│ │ └── install.sls
│ ├── clean.sls
│ ├── config
│ │ ├── clean.sls
│ │ ├── environ.sls
│ │ ├── file.sls
│ │ └── init.sls
│ └── init.sls
├── defaults.yaml
├── devlibs
│ ├── archive
│ │ ├── clean.sls
│ │ ├── init.sls
│ │ └── install.sls
│ ├── clean.sls
│ └── init.sls
├── devtools
│ ├── alternatives
│ │ ├── clean.sls
│ │ ├── init.sls
│ │ └── install.sls
│ ├── archive
│ │ ├── clean.sls
│ │ ├── init.sls
│ │ └── install.sls
│ ├── binary
│ │ ├── clean.sls
│ │ ├── init.sls
│ │ └── install.sls
│ ├── clean.sls
│ └── init.sls
├── files
│ ├── default
│ │ ├── aliases.sh.jinja
│ │ ├── config.yml.jinja
│ │ └── environ.sh.jinja
│ └── macros.jinja
├── init.sls
├── k3s
│ ├── alternatives
│ │ ├── clean.sls
│ │ ├── init.sls
│ │ └── install.sls
│ ├── binary
│ │ ├── clean.sls
│ │ ├── init.sls
│ │ └── install.sls
│ ├── clean.sls
│ ├── config
│ │ ├── clean.sls
│ │ ├── file.sls
│ │ └── init.sls
│ ├── init.sls
│ └── script
│ │ ├── clean.sls
│ │ ├── init.sls
│ │ └── install.sls
├── kubectl
├── libtofs.jinja
├── map.jinja
├── node
│ ├── alternatives
│ │ ├── clean.sls
│ │ ├── init.sls
│ │ └── install.sls
│ ├── archive
│ │ ├── clean.sls
│ │ ├── init.sls
│ │ └── install.sls
│ ├── clean.sls
│ ├── config
│ │ ├── clean.sls
│ │ ├── environ.sls
│ │ ├── file.sls
│ │ └── init.sls
│ ├── init.sls
│ └── package
│ │ ├── clean.sls
│ │ ├── init.sls
│ │ └── install.sls
├── operator
│ ├── clean.sls
│ ├── init.sls
│ └── sdk
│ │ ├── binary
│ │ ├── clean.sls
│ │ ├── init.sls
│ │ └── install.sls
│ │ ├── clean.sls
│ │ └── init.sls
├── operators
│ ├── archive
│ │ ├── clean.sls
│ │ ├── init.sls
│ │ └── install.sls
│ ├── clean.sls
│ └── init.sls
├── osarchmap.yaml
├── osfamilymap.yaml
├── osfingermap.yaml
├── osmap.yaml
├── package
│ └── repo
│ │ ├── clean.sls
│ │ ├── init.sls
│ │ └── install.sls
├── server
│ ├── alternatives
│ │ ├── clean.sls
│ │ ├── init.sls
│ │ └── install.sls
│ ├── archive
│ │ ├── clean.sls
│ │ ├── init.sls
│ │ └── install.sls
│ ├── clean.sls
│ ├── config
│ │ ├── clean.sls
│ │ ├── environ.sls
│ │ ├── file.sls
│ │ └── init.sls
│ ├── init.sls
│ └── package
│ │ ├── clean.sls
│ │ ├── init.sls
│ │ └── install.sls
└── sigs
│ ├── alternatives
│ ├── clean.sls
│ ├── init.sls
│ └── install.sls
│ ├── archive
│ ├── clean.sls
│ ├── init.sls
│ └── install.sls
│ ├── binary
│ ├── clean.sls
│ ├── init.sls
│ └── install.sls
│ ├── clean.sls
│ └── init.sls
├── pillar.example
├── pre-commit_semantic-release.sh
├── release-rules.js
├── release.config.js
└── test
├── integration
├── alma
│ ├── README.md
│ ├── controls
│ │ └── default_spec.rb
│ └── inspec.yml
├── arch
│ ├── README.md
│ ├── controls
│ │ └── default_spec.rb
│ └── inspec.yml
├── default
│ ├── README.md
│ ├── controls
│ │ └── default_spec.rb
│ └── inspec.yml
├── redhat
│ ├── README.md
│ ├── controls
│ │ └── default_spec.rb
│ └── inspec.yml
└── script
│ ├── README.md
│ ├── controls
│ └── default_spec.rb
│ └── inspec.yml
└── salt
└── pillar
├── alma.sls
├── default.sls
├── redhat.sls
└── script.sls
/.github/workflows/commitlint.yml:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=yaml
3 | ---
4 | name: Commitlint
5 | 'on': [pull_request]
6 |
7 | jobs:
8 | lint:
9 | runs-on: ubuntu-latest
10 | env:
11 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12 | steps:
13 | - uses: actions/checkout@v2
14 | with:
15 | fetch-depth: 0
16 | - uses: wagoid/commitlint-github-action@v1
17 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Byte-compiled / optimized / DLL files
2 | __pycache__/
3 | *.py[cod]
4 | *$py.class
5 |
6 | # C extensions
7 | *.so
8 |
9 | # Distribution / packaging
10 | .Python
11 | env/
12 | build/
13 | develop-eggs/
14 | dist/
15 | downloads/
16 | eggs/
17 | .eggs/
18 | lib/
19 | lib64/
20 | parts/
21 | sdist/
22 | var/
23 | wheels/
24 | *.egg-info/
25 | .installed.cfg
26 | *.egg
27 |
28 | # PyInstaller
29 | # Usually these files are written by a python script from a packager
30 | # before PyInstaller builds the exe, so as to inject date/other infos into it.
31 | *.manifest
32 | *.spec
33 |
34 | # Installer logs
35 | pip-log.txt
36 | pip-delete-this-directory.txt
37 |
38 | # Unit test / coverage reports
39 | htmlcov/
40 | .tox/
41 | .coverage
42 | .coverage.*
43 | .cache
44 | nosetests.xml
45 | coverage.xml
46 | *.cover
47 | .hypothesis/
48 | .kitchen
49 | .kitchen.local.yml
50 | kitchen.local.yml
51 | junit-*.xml
52 |
53 | # Translations
54 | *.mo
55 | *.pot
56 |
57 | # Django stuff:
58 | *.log
59 | local_settings.py
60 |
61 | # Flask stuff:
62 | instance/
63 | .webassets-cache
64 |
65 | # Scrapy stuff:
66 | .scrapy
67 |
68 | # Sphinx documentation
69 | docs/_build/
70 |
71 | # PyBuilder
72 | target/
73 |
74 | # Jupyter Notebook
75 | .ipynb_checkpoints
76 |
77 | # pyenv
78 | .python-version
79 |
80 | # celery beat schedule file
81 | celerybeat-schedule
82 |
83 | # SageMath parsed files
84 | *.sage.py
85 |
86 | # dotenv
87 | .env
88 |
89 | # virtualenv
90 | .venv
91 | venv/
92 | ENV/
93 |
94 | # Spyder project settings
95 | .spyderproject
96 | .spyproject
97 |
98 | # Rope project settings
99 | .ropeproject
100 |
101 | # mkdocs documentation
102 | /site
103 |
104 | # mypy
105 | .mypy_cache/
106 |
107 | # Bundler
108 | .bundle/
109 |
110 | # copied `.md` files used for conversion to `.rst` using `m2r`
111 | docs/*.md
112 |
113 | # Vim
114 | *.sw?
115 |
116 | ## Collected when centralising formulas (check and sort)
117 | # `collectd-formula`
118 | .pytest_cache/
119 | /.idea/
120 | Dockerfile.*_*
121 | ignore/
122 | tmp/
123 |
--------------------------------------------------------------------------------
/.pre-commit-config.yaml:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=yaml
3 | ---
4 | # See https://pre-commit.com for more information
5 | # See https://pre-commit.com/hooks.html for more hooks
6 | ci:
7 | autofix_commit_msg: |
8 | ci(pre-commit.ci): apply auto fixes from pre-commit.com hooks
9 |
10 | For more information, see https://pre-commit.ci
11 | autofix_prs: true
12 | autoupdate_branch: ''
13 | autoupdate_commit_msg: |
14 | ci(pre-commit.ci): perform `pre-commit` autoupdate
15 | autoupdate_schedule: quarterly
16 | skip: []
17 | submodules: false
18 | default_stages: [commit]
19 | repos:
20 | - repo: https://github.com/dafyddj/commitlint-pre-commit-hook
21 | rev: v2.3.0
22 | hooks:
23 | - id: commitlint
24 | name: Check commit message using commitlint
25 | description: Lint commit message against @commitlint/config-conventional rules
26 | stages: [commit-msg]
27 | additional_dependencies: ['@commitlint/config-conventional@8.3.4']
28 | - id: commitlint-travis
29 | stages: [manual]
30 | additional_dependencies: ['@commitlint/config-conventional@8.3.4']
31 | always_run: true
32 | - repo: https://github.com/rubocop-hq/rubocop
33 | rev: v1.30.1
34 | hooks:
35 | - id: rubocop
36 | name: Check Ruby files with rubocop
37 | args: [--debug]
38 | always_run: true
39 | pass_filenames: false
40 | - repo: https://github.com/shellcheck-py/shellcheck-py
41 | rev: v0.8.0.4
42 | hooks:
43 | - id: shellcheck
44 | name: Check shell scripts with shellcheck
45 | files: ^.*\.(sh|bash|ksh)$
46 | types: []
47 | - repo: https://github.com/adrienverge/yamllint
48 | rev: v1.26.3
49 | hooks:
50 | - id: yamllint
51 | name: Check YAML syntax with yamllint
52 | args: [--strict, '.']
53 | always_run: true
54 | pass_filenames: false
55 | - repo: https://github.com/warpnet/salt-lint
56 | rev: v0.8.0
57 | hooks:
58 | - id: salt-lint
59 | name: Check Salt files using salt-lint
60 | files: ^.*\.(sls|jinja|j2|tmpl|tst)$
61 | - repo: https://github.com/myint/rstcheck
62 | rev: 3f929574
63 | hooks:
64 | - id: rstcheck
65 | name: Check reST files using rstcheck
66 | exclude: 'docs/CHANGELOG.rst'
67 | - repo: https://github.com/saltstack-formulas/mirrors-rst-lint
68 | rev: v1.3.2
69 | hooks:
70 | - id: rst-lint
71 | name: Check reST files using rst-lint
72 | exclude: |
73 | (?x)^(
74 | docs/CHANGELOG.rst|
75 | docs/TOFS_pattern.rst|
76 | )$
77 | additional_dependencies: [pygments==2.9.0]
78 |
--------------------------------------------------------------------------------
/.rstcheck.cfg:
--------------------------------------------------------------------------------
1 | [rstcheck]
2 | report=info
3 | ignore_language=rst
4 | ignore_messages=(Duplicate (ex|im)plicit target.*|Hyperlink target ".*" is not referenced\.$)
5 |
--------------------------------------------------------------------------------
/.rubocop.yml:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=yaml
3 | ---
4 | # General overrides used across formulas in the org
5 | Layout/LineLength:
6 | # Increase from default of `80`
7 | # Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`)
8 | Max: 88
9 | Metrics/BlockLength:
10 | IgnoredMethods:
11 | - control
12 | - describe
13 | # Increase from default of `25`
14 | Max: 30
15 | Security/YAMLLoad:
16 | Exclude:
17 | - test/integration/**/_mapdata.rb
18 |
19 | # Any offenses that should be fixed, e.g. collected via. `rubocop --auto-gen-config`
20 |
--------------------------------------------------------------------------------
/.salt-lint:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=yaml
3 | ---
4 | exclude_paths: []
5 | rules: {}
6 | skip_list:
7 | # Using `salt-lint` for linting other files as well, such as Jinja macros/templates
8 | - 205 # Use ".sls" as a Salt State file extension
9 | # Skipping `207` and `208` because `210` is sufficient, at least for the time-being
10 | # I.e. Allows 3-digit unquoted codes to still be used, such as `644` and `755`
11 | - 207 # File modes should always be encapsulated in quotation marks
12 | - 208 # File modes should always contain a leading zero
13 | tags: []
14 | verbosity: 1
15 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=yaml
3 | ---
4 | ## Machine config
5 | os: 'linux'
6 | arch: 'amd64'
7 | dist: 'bionic'
8 | version: '~> 1.0'
9 |
10 | ## Language and cache config
11 | language: 'ruby'
12 | cache: 'bundler'
13 |
14 | env:
15 | global:
16 | - CHANGE_MINIKUBE_NONE_USER=true
17 | - MINIKUBE_WANTUPDATENOTIFICATION=false
18 | - MINIKUBE_WANTREPORTERRORPROMPT=false
19 | - MINIKUBE_HOME=$HOME
20 | - CHANGE_MINIKUBE_NONE_USER=true
21 | - KUBECONFIG=$HOME/.kube/config
22 |
23 | ## Services config
24 | services:
25 | - docker
26 |
27 | ## Script to run for the test stage
28 | script:
29 | - env
30 | - bin/kitchen verify "${INSTANCE}"
31 |
32 | ## Stages and jobs matrix
33 | stages:
34 | - test
35 | - name: 'release'
36 | if: 'branch = master AND type != pull_request'
37 | jobs:
38 | include:
39 | ## Define the test stage that runs the linters (and testing matrix, if applicable)
40 |
41 | # Run all of the linters in a single job
42 | - language: 'node_js'
43 | node_js: 'lts/*'
44 | env: 'Lint'
45 | name: 'Lint: salt-lint, yamllint, rubocop, shellcheck & commitlint'
46 | before_install: 'skip'
47 | script:
48 | # Install and run `salt-lint`
49 | - pip install --user salt-lint
50 | - git ls-files -- '*.sls' '*.jinja' '*.j2' '*.tmpl' '*.tst'
51 | | xargs salt-lint
52 | # Install and run `yamllint`
53 | # Need at least `v1.17.0` for the `yaml-files` setting
54 | - pip install --user yamllint>=1.17.0
55 | - yamllint -s .
56 | # Install and run `rubocop`
57 | - gem install rubocop
58 | - rubocop -d
59 | # Run `shellcheck` (already pre-installed in Travis)
60 | - shellcheck --version
61 | - git ls-files -- '*.sh' '*.bash' '*.ksh'
62 | | xargs shellcheck
63 | # Install and run `commitlint`
64 | - npm i -D @commitlint/config-conventional
65 | @commitlint/travis-cli
66 | - commitlint-travis
67 |
68 | ## Define the rest of the matrix based on Kitchen testing
69 | # Make sure the instances listed below match up with
70 | # the `platforms` defined in `kitchen.yml`
71 | - env: INSTANCE=default-debian-10-master-py3
72 | - env: INSTANCE=default-ubuntu-1804-master-py3
73 | - env: INSTANCE=redhat-centos-8-master-py3
74 | - env: INSTANCE=redhat-fedora-31-master-py3
75 | - env: INSTANCE=default-opensuse-leap-151-master-py3
76 | - env: INSTANCE=default-amazonlinux-2-master-py3
77 | # k3s script install tests
78 | - env: INSTANCE=script-ubuntu-1804-master-py3
79 | # - env: INSTANCE=script-amazonlinux-2-master-py3
80 | # - env: INSTANCE=default-debian-10-3000-2-py3
81 | # - env: INSTANCE=default-debian-9-3000-2-py3
82 | # - env: INSTANCE=default-ubuntu-1804-3000-2-py3
83 | # - env: INSTANCE=default-centos-8-3000-2-py3
84 | # - env: INSTANCE=default-centos-7-3000-2-py3
85 | # - env: INSTANCE=default-fedora-31-3000-2-py3
86 | # - env: INSTANCE=default-opensuse-leap-151-3000-2-py3
87 | # - env: INSTANCE=default-amazonlinux-2-3000-2-py3
88 | # - env: INSTANCE=default-ubuntu-1804-3000-2-py2
89 | # - env: INSTANCE=default-ubuntu-1604-3000-2-py2
90 | # - env: INSTANCE=arch-arch-base-latest-3000-2-py2
91 | # - env: INSTANCE=default-debian-10-2019-2-py3
92 | # - env: INSTANCE=default-debian-9-2019-2-py3
93 | # - env: INSTANCE=default-ubuntu-1804-2019-2-py3
94 | # - env: INSTANCE=default-ubuntu-1604-2019-2-py3
95 | # - env: INSTANCE=default-centos-8-2019-2-py3
96 | # - env: INSTANCE=default-centos-7-2019-2-py3
97 | # - env: INSTANCE=default-fedora-31-2019-2-py3
98 | # env: INSTANCE=default-opensuse-leap-151-2019-2-py3
99 | # - env: INSTANCE=default-amazonlinux-2-2019-2-py3
100 | # - env: INSTANCE=default-centos-6-2019-2-py2
101 | # - env: INSTANCE=default-amazonlinux-1-2019-2-py2
102 | - env: INSTANCE=arch-arch-base-latest-2019-2-py2
103 |
104 | ## Define the release stage that runs `semantic-release`
105 | - stage: 'release'
106 | language: 'node_js'
107 | node_js: 'lts/*'
108 | env: 'Release'
109 | name: 'Run semantic-release inc. file updates to AUTHORS, CHANGELOG & FORMULA'
110 | before_install: 'skip'
111 | script:
112 | # Update `AUTHORS.md`
113 | - export MAINTAINER_TOKEN=${GH_TOKEN}
114 | - go get github.com/myii/maintainer
115 | - maintainer contributor
116 |
117 | # Install all dependencies required for `semantic-release`
118 | - npm i -D @semantic-release/changelog@3
119 | @semantic-release/exec@3
120 | @semantic-release/git@7
121 | deploy:
122 | provider: 'script'
123 | # Opt-in to `dpl v2` to complete the Travis build config validation (beta)
124 | # * https://docs.travis-ci.com/user/build-config-validation
125 | # Deprecated `skip_cleanup` can now be avoided, `cleanup: false` is by default
126 | edge: true
127 | # Run `semantic-release`
128 | script: 'npx semantic-release@15.14'
129 |
--------------------------------------------------------------------------------
/.yamllint:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=yaml
3 | ---
4 | # Extend the `default` configuration provided by `yamllint`
5 | extends: 'default'
6 |
7 | # Files to ignore completely
8 | # 1. All YAML files under directory `.cache/`, introduced during the GitLab CI run
9 | # 2. All YAML files under directory `.git/`
10 | # 3. All YAML files under directory `node_modules/`, introduced during the Travis run
11 | # 4. Any SLS files under directory `test/`, which are actually state files
12 | # 5. Any YAML files under directory `.kitchen/`, introduced during local testing
13 | # 6. `kitchen.vagrant.yml`, which contains Embedded Ruby (ERB) template syntax
14 | ignore: |
15 | .cache/
16 | .git/
17 | node_modules/
18 | test/**/states/**/*.sls
19 | .kitchen/
20 | kitchen.vagrant.yml
21 | kubernetes/osfamilymap.yaml
22 | kubernetes/defaults.yaml
23 | kubernetes/osarchmap.yaml
24 | kubernetes/files/defaults/aliases.sh
25 | pillar.example
26 | test/salt/pillar/default.sls
27 | test/salt/pillar/redhat.sls
28 |
29 | yaml-files:
30 | # Default settings
31 | - '*.yaml'
32 | - '*.yml'
33 | - .salt-lint
34 | - .yamllint
35 | # SaltStack Formulas additional settings
36 | - '*.example'
37 | - test/**/*.sls
38 |
39 | rules:
40 | empty-values:
41 | forbid-in-block-mappings: true
42 | forbid-in-flow-mappings: true
43 | line-length:
44 | # Increase from default of `80`
45 | # Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`)
46 | max: 88
47 | octal-values:
48 | forbid-implicit-octal: true
49 | forbid-explicit-octal: true
50 |
--------------------------------------------------------------------------------
/AUTHORS.md:
--------------------------------------------------------------------------------
1 | # Authors
2 |
3 | This list is sorted by the number of commits per contributor in _descending_ order.
4 |
5 | Avatar|Contributor|Contributions
6 | :-:|---|:-:
7 |
|[@noelmcloughlin](https://github.com/noelmcloughlin)|113
8 |
|[@dependabot[bot]](https://github.com/apps/dependabot)|1
9 |
10 | ---
11 |
12 | Auto-generated by a [forked version](https://github.com/myii/maintainer) of [gaocegege/maintainer](https://github.com/gaocegege/maintainer) on 2020-11-12.
13 |
--------------------------------------------------------------------------------
/CODEOWNERS:
--------------------------------------------------------------------------------
1 | # https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners
2 |
3 | # SECTION: Owner(s) for everything in the repo, unless a later match takes precedence
4 | # FILE PATTERN OWNER(S)
5 | * @noelmcloughlin
6 |
7 | # SECTION: Owner(s) for specific directories
8 | # FILE PATTERN OWNER(S)
9 |
10 | # SECTION: Owner(s) for files/directories related to `semantic-release`
11 | # FILE PATTERN OWNER(S)
12 | /.github/workflows/ @saltstack-formulas/ssf
13 | /bin/install-hooks @saltstack-formulas/ssf
14 | /bin/kitchen @saltstack-formulas/ssf
15 | /docs/AUTHORS.rst @saltstack-formulas/ssf
16 | /docs/CHANGELOG.rst @saltstack-formulas/ssf
17 | /docs/TOFS_pattern.rst @saltstack-formulas/ssf
18 | /*/_mapdata/ @saltstack-formulas/ssf
19 | /*/libsaltcli.jinja @saltstack-formulas/ssf
20 | /*/libtofs.jinja @saltstack-formulas/ssf
21 | /test/integration/**/_mapdata.rb @saltstack-formulas/ssf
22 | /test/integration/**/libraries/system.rb @saltstack-formulas/ssf
23 | /test/integration/**/inspec.yml @saltstack-formulas/ssf
24 | /test/integration/**/README.md @saltstack-formulas/ssf
25 | /test/salt/pillar/top.sls @saltstack-formulas/ssf
26 | /.gitignore @saltstack-formulas/ssf
27 | /.cirrus.yml @saltstack-formulas/ssf
28 | /.gitlab-ci.yml @saltstack-formulas/ssf
29 | /.pre-commit-config.yaml @saltstack-formulas/ssf
30 | /.rstcheck.cfg @saltstack-formulas/ssf
31 | /.rubocop.yml @saltstack-formulas/ssf
32 | /.salt-lint @saltstack-formulas/ssf
33 | /.travis.yml @saltstack-formulas/ssf
34 | /.yamllint @saltstack-formulas/ssf
35 | /AUTHORS.md @saltstack-formulas/ssf
36 | /CHANGELOG.md @saltstack-formulas/ssf
37 | /CODEOWNERS @saltstack-formulas/ssf
38 | /commitlint.config.js @saltstack-formulas/ssf
39 | /FORMULA @saltstack-formulas/ssf
40 | /Gemfile @saltstack-formulas/ssf
41 | /Gemfile.lock @saltstack-formulas/ssf
42 | /kitchen.yml @saltstack-formulas/ssf
43 | /kitchen.vagrant.yml @saltstack-formulas/ssf
44 | /kitchen.windows.yml @saltstack-formulas/ssf
45 | /pre-commit_semantic-release.sh @saltstack-formulas/ssf
46 | /release-rules.js @saltstack-formulas/ssf
47 | /release.config.js @saltstack-formulas/ssf
48 |
49 | # SECTION: Owner(s) for specific files
50 | # FILE PATTERN OWNER(S)
51 |
--------------------------------------------------------------------------------
/FORMULA:
--------------------------------------------------------------------------------
1 | name: kubernetes
2 | os: Debian, Ubuntu, Raspbian, RedHat, Fedora, CentOS, Amazon, Suse, openSUSE, Gentoo, Funtoo, Arch, Manjaro, Alpine, FreeBSD, OpenBSD, Solaris, SmartOS, Windows, MacOS
3 | os_family: Debian, RedHat, Suse, Gentoo, Arch, Alpine, FreeBSD, OpenBSD, Solaris, Windows, MacOS
4 | version: 1.3.1
5 | release: 1
6 | minimum_version: 2019.2
7 | summary: kubernetes formula
8 | description: Formula to install kubernetes and configure it
9 | top_level_dir: kubernetes
10 |
--------------------------------------------------------------------------------
/Gemfile:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | source ENV.fetch('PROXY_RUBYGEMSORG', 'https://rubygems.org')
4 |
5 | # Install the `inspec` gem using `git` because versions after `4.22.22`
6 | # suppress diff output; this version fixes this for our uses.
7 | # rubocop:disable Layout/LineLength
8 | gem 'inspec', git: 'https://gitlab.com/saltstack-formulas/infrastructure/inspec', branch: 'ssf'
9 | # rubocop:enable Layout/LineLength
10 |
11 | # Install the `kitchen-docker` gem using `git` in order to gain a performance
12 | # improvement: avoid package installations which are already covered by the
13 | # `salt-image-builder` (i.e. the pre-salted images that we're using)
14 | # rubocop:disable Layout/LineLength
15 | gem 'kitchen-docker', git: 'https://gitlab.com/saltstack-formulas/infrastructure/kitchen-docker', branch: 'ssf'
16 | # rubocop:enable Layout/LineLength
17 |
18 | gem 'kitchen-inspec', '>= 2.5.0'
19 | gem 'kitchen-salt', '>= 0.7.2'
20 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2014 Salt Stack Formulas
2 |
3 | Licensed under the Apache License, Version 2.0 (the "License");
4 | you may not use this file except in compliance with the License.
5 | You may obtain a copy of the License at
6 |
7 | http://www.apache.org/licenses/LICENSE-2.0
8 |
9 | Unless required by applicable law or agreed to in writing, software
10 | distributed under the License is distributed on an "AS IS" BASIS,
11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | See the License for the specific language governing permissions and
13 | limitations under the License.
14 |
--------------------------------------------------------------------------------
/bin/kitchen:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | # frozen_string_literal: true
3 |
4 | #
5 | # This file was generated by Bundler.
6 | #
7 | # The application 'kitchen' is installed as part of a gem, and
8 | # this file is here to facilitate running it.
9 | #
10 |
11 | require 'pathname'
12 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
13 | Pathname.new(__FILE__).realpath)
14 |
15 | bundle_binstub = File.expand_path('bundle', __dir__)
16 |
17 | if File.file?(bundle_binstub)
18 | if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19 | load(bundle_binstub)
20 | else
21 | abort('Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22 | Replace `bin/bundle` by running `bundle binstubs bundler --force`, & run cmd again.')
23 | end
24 | end
25 |
26 | require 'rubygems'
27 | require 'bundler/setup'
28 |
29 | load Gem.bin_path('test-kitchen', 'kitchen')
30 |
--------------------------------------------------------------------------------
/commitlint.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | extends: ['@commitlint/config-conventional'],
3 | rules: {
4 | 'body-max-line-length': [2, 'always', 220],
5 | 'footer-max-line-length': [2, 'always', 220],
6 | },
7 |
8 | };
9 |
--------------------------------------------------------------------------------
/docs/AUTHORS.rst:
--------------------------------------------------------------------------------
1 | .. role:: raw-html-m2r(raw)
2 | :format: html
3 |
4 |
5 | Authors
6 | =======
7 |
8 | This list is sorted by the number of commits per contributor in *descending* order.
9 |
10 | .. list-table::
11 | :header-rows: 1
12 |
13 | * - Avatar
14 | - Contributor
15 | - Contributions
16 | * - :raw-html-m2r:`
`
17 | - `@noelmcloughlin `_
18 | - 113
19 | * - :raw-html-m2r:`
`
20 | - `@dependabot[bot] `_
21 | - 1
22 |
23 |
24 | ----
25 |
26 | Auto-generated by a `forked version `_ of `gaocegege/maintainer `_ on 2020-11-12.
27 |
--------------------------------------------------------------------------------
/docs/CONTRIBUTING_DOCS.rst:
--------------------------------------------------------------------------------
1 | .. _contributing_docs:
2 |
3 | Contributing documentation
4 | ==========================
5 |
6 | |docs|
7 |
8 | .. |docs| image:: https://readthedocs.org/projects/docs/badge/?version=latest
9 | :alt: Documentation Status
10 | :scale: 100%
11 | :target: https://kubernetes-formula.readthedocs.io/en/latest/?badge=latest
12 |
13 | Toolchain
14 | ^^^^^^^^^
15 |
16 | The documentation for this formula is written in
17 | `reStructuredText `_
18 | (also known as RST, ReST, or reST).
19 | It is built by
20 | `Sphinx `_
21 | and hosted on
22 | `Read the Docs `_.
23 |
24 | Adding a new page
25 | ^^^^^^^^^^^^^^^^^
26 |
27 | Adding a new page involves two steps:
28 |
29 | #. Use the
30 | :ref:`provided page template `
31 | to create a new page.
32 | #. Add the page name under the ``toctree`` list in ``index.rst``.
33 |
34 | a. Do not just append it to the list.
35 | #. Select the best place where it fits within the overall documentation.
36 |
37 | .. _saltstack_formulas_rst_page_template:
38 |
39 | SaltStack-Formulas' RST page template
40 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
41 |
42 | Use the following template when creating a new page.
43 | This ensures consistency across the documentation for this formula.
44 | The heading symbols have been selected in accordance to the output rendered by the
45 | `Markdown to reStructuredText converter `_
46 | we are using for some of the pages of this documentation.
47 |
48 | .. code-block:: rst
49 |
50 | .. _template:
51 |
52 | [Page title]
53 | ============
54 |
55 | [Introductory paragraph]
56 |
57 | .. contents:: **Table of Contents**
58 |
59 | [Heading 2]
60 | -----------
61 |
62 | [Heading 3]
63 | ^^^^^^^^^^^
64 |
65 | [Heading 4]
66 | ~~~~~~~~~~~
67 |
68 | [Heading 5]
69 | """""""""""
70 |
71 | [Heading 6]
72 | ###########
73 |
74 | #. The first line is an anchor that can be used to link back to (the top of)
75 | this file.
76 |
77 | a. Change this to be the lowercase version of the file name.
78 | #. Do not include the ``.rst`` file extension.
79 | #. Use hyphens (``-``) instead of spaces or non-letter characters.
80 |
81 | #. Change the ``[Page title]`` accordingly, matching the same number of equals
82 | signs (``=``) underneath.
83 | #. Change the ``[Introductory paragraph]`` to be a short summary of the page
84 | content.
85 | Use no more than three paragraphs for this.
86 | #. Leave the ``..contents:: **Table of Contents**`` line as it is.
87 | #. Use the remaining headings as required to break up the page content.
88 |
89 | a. You will rarely need to use beyond ``[Heading 4]``.
90 | #. Again, no single heading should have more than about three paragraphs of
91 | content before the next heading or sub-heading is used.
92 |
93 | Obviously, it is not necessary to follow the steps in the order above.
94 | For example, it is usually easier to write the ``[Introductory paragraph]``
95 | at the end.
96 |
--------------------------------------------------------------------------------
/docs/_static/css/custom.css:
--------------------------------------------------------------------------------
1 | /*
2 | Override styles for in-use Sphinx theme
3 | */
4 |
5 | /* The next two `.wy`-based rules are specifically needed for the dealing with */
6 | /* the `sphinx_rtd_theme` bug where long lines do not wrap in tables */
7 |
8 | /* override table width restrictions */
9 | .wy-table-responsive table th
10 | , .wy-table-responsive table td
11 | {
12 | /* !important prevents the common CSS stylesheets from
13 | overriding this as on RTD they are loaded after this stylesheet */
14 | white-space: normal !important;
15 | }
16 |
17 | .wy-table-responsive
18 | {
19 | overflow: visible !important;
20 | }
21 |
22 |
--------------------------------------------------------------------------------
/docs/conf.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """Configuration file for the Sphinx documentation builder.
3 |
4 | This file does only contain a selection of the most common options. For a
5 | full list see the documentation:
6 |
7 | * http://www.sphinx-doc.org/en/stable/config
8 |
9 | """
10 |
11 | from __future__ import division, print_function, unicode_literals
12 |
13 | # from datetime import datetime
14 |
15 | from recommonmark.parser import CommonMarkParser
16 |
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. If not, see .
19 | __author__ = 'Imran Iqbal' # noqa: E221
20 | __copyright__ = 'Copyright (C) 2019, MYII' # noqa: E221
21 | __license__ = 'Apache-2.0' # noqa: E221
22 | __version__ = 'latest' # noqa: E221
23 | __maintainer__ = 'Imran Iqbal' # noqa: E221
24 |
25 |
26 | # -- Project information -----------------------------------------------------
27 |
28 | project = 'template-formula'
29 | copyright = __copyright__.replace('Copyright (C) ', '') # noqa: A001
30 | author = __author__
31 | version = __version__
32 | release = __version__
33 |
34 |
35 | # -- General configuration ---------------------------------------------------
36 |
37 | # If your documentation needs a minimal Sphinx version, state it here.
38 | #
39 | # needs_sphinx = '1.0'
40 |
41 | # Add any Sphinx extension module names here, as strings. They can be
42 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
43 | # ones.
44 | extensions = []
45 |
46 | # Add any paths that contain templates here, relative to this directory.
47 | templates_path = ['templates', '_templates', '.templates']
48 |
49 | # The suffix(es) of source filenames.
50 | # You can specify multiple suffix as a list of string:
51 | #
52 | source_suffix = ['.rst', '.md']
53 |
54 | # The master toctree document.
55 | master_doc = 'index'
56 |
57 | # The language for content autogenerated by Sphinx. Refer to documentation
58 | # for a list of supported languages.
59 | #
60 | # This is also used if you do content translation via gettext catalogs.
61 | # Usually you set "language" from the command line for these cases.
62 | language = None
63 |
64 | # List of patterns, relative to source directory, that match files and
65 | # directories to ignore when looking for source files.
66 | # This pattern also affects html_static_path and html_extra_path .
67 | exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
68 |
69 | # The name of the Pygments (syntax highlighting) style to use.
70 | pygments_style = 'sphinx'
71 |
72 |
73 | # -- Options for the reStructuredText parser ---------------------------------
74 |
75 | file_insertion_enabled = False
76 |
77 |
78 | # -- Options for HTML output -------------------------------------------------
79 |
80 | # The theme to use for HTML and HTML Help pages. See the documentation for
81 | # a list of builtin themes.
82 | #
83 | html_theme = 'sphinx_rtd_theme'
84 |
85 | # Theme options are theme-specific and customize the look and feel of a theme
86 | # further. For a list of options available for each theme, see the
87 | # documentation.
88 | #
89 | # html_theme_options = {}
90 |
91 | # Add any paths that contain custom static files (such as style sheets) here,
92 | # relative to this directory. They are copied after the builtin static files,
93 | # so a file named "default.css" will overwrite the builtin "default.css".
94 | html_static_path = ['_static']
95 |
96 | # Custom sidebar templates, must be a dictionary that maps document names
97 | # to template names.
98 | #
99 | # The default sidebars (for documents that don't match any pattern) are
100 | # defined by theme itself. Builtin themes are using these templates by
101 | # default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
102 | # 'searchbox.html']``.
103 | #
104 | # html_sidebars = {}
105 |
106 |
107 | # -- Options for HTMLHelp output ---------------------------------------------
108 |
109 | # Output file base name for HTML help builder.
110 | htmlhelp_basename = 'template-formula'
111 |
112 |
113 | # -- Options for Markdown output ---------------------------------------------
114 |
115 | source_parsers = {
116 | '.md': CommonMarkParser,
117 | }
118 |
119 |
120 | # -- Options for LaTeX output ------------------------------------------------
121 |
122 | latex_elements = {
123 | # The paper size ('letterpaper' or 'a4paper').
124 | #
125 | # 'papersize': 'letterpaper',
126 |
127 | # The font size ('10pt', '11pt' or '12pt').
128 | #
129 | # 'pointsize': '10pt',
130 |
131 | # Additional stuff for the LaTeX preamble.
132 | #
133 | # 'preamble': '',
134 |
135 | # Latex figure (float) alignment
136 | #
137 | # 'figure_align': 'htbp',
138 | }
139 |
140 | # Grouping the document tree into LaTeX files. List of tuples
141 | # (source start file, target name, title,
142 | # author, documentclass [howto, manual, or own class]).
143 | latex_documents = [
144 | (
145 | 'index',
146 | 'template-formula.tex',
147 | u'template-formula Documentation',
148 | u'',
149 | 'manual',
150 | ),
151 | ]
152 |
153 |
154 | # -- Functions: `setup`, docstring preprocessing, etc. -----------------------
155 |
156 | def setup(app):
157 | """Prepare the Sphinx application object.
158 |
159 | Used for providing a custom CSS file for override styles.
160 |
161 | Parameters
162 | ----------
163 | app : object
164 | The Sphinx application object.
165 |
166 | Returns
167 | -------
168 | app : object
169 | The Sphinx application object.
170 |
171 | """
172 | app.add_stylesheet('css/custom.css')
173 | return app
174 |
--------------------------------------------------------------------------------
/docs/index.rst:
--------------------------------------------------------------------------------
1 | .. _index:
2 |
3 | .. ``template-formula`` documentation master file.
4 | You can adapt this file completely to your liking, but it should at least
5 | contain the root `toctree` directive.
6 |
7 | Welcome to template-formula's documentation!
8 | ============================================
9 |
10 | .. toctree::
11 | :maxdepth: 2
12 | :caption: Contents
13 | :numbered:
14 | :glob:
15 |
16 | README
17 | CONTRIBUTING
18 | TOFS_pattern
19 | AUTHORS
20 | CHANGELOG
21 |
--------------------------------------------------------------------------------
/kubernetes/clean.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .k3s.clean
6 | - .node.clean
7 | - .server.clean
8 | - .client.clean
9 | - .operators.clean
10 | - .operator.clean
11 | - .devtools.clean
12 | - .devlibs.clean
13 | - .sigs.clean
14 | - .crimgr.clean
15 |
--------------------------------------------------------------------------------
/kubernetes/client/aliases/clean.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | kubernetes-client-aliases-clean:
8 | file.absent:
9 | - names:
10 | - {{ d.client.aliases_file }}
11 |
--------------------------------------------------------------------------------
/kubernetes/client/aliases/init.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .install
6 |
--------------------------------------------------------------------------------
/kubernetes/client/aliases/install.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- if grains.os != 'Windows' %}
8 | {%- from tplroot ~ "/libtofs.jinja" import files_switch with context %}
9 | {%- set sls_archive_install = tplroot ~ '.client.archive.install' %}
10 | {%- set sls_binary_install = tplroot ~ '.client.binary.install' %}
11 | {%- set sls_package_install = tplroot ~ '.client.package.install' %}
12 |
13 | include:
14 | - {{ sls_archive_install if d.client.pkg.use_upstream == 'archive' else sls_binary_install if d.client.pkg.use_upstream == 'binary' else sls_package_install }} # noqa 204
15 |
16 | kubernetes-client-aliases-file-managed-environ_file:
17 | file.managed:
18 | - name: {{ d.client.aliases_file }}
19 | - source: {{ files_switch(['aliases.sh.jinja'],
20 | lookup='k8s-client-aliases-file-managed-environ_file'
21 | )
22 | }}
23 | - makedirs: True
24 | {%- if grains.os != 'Windows' %}
25 | - mode: '0640'
26 | - user: {{ d.identity.rootuser }}
27 | - group: {{ d.identity.rootgroup }}
28 | {%- endif %}
29 | - template: jinja
30 | - require:
31 | - sls: {{ sls_archive_install if d.client.pkg.use_upstream == 'archive' else sls_binary_install if d.client.pkg.use_upstream == 'binary' else sls_package_install }} # noqa 204
32 |
33 | {%- endif %}
34 |
--------------------------------------------------------------------------------
/kubernetes/client/alternatives/clean.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- if d.linux.altpriority|int > 0 and grains.kernel == 'Linux' and grains.os_family not in ('Arch',) %}
8 | {%- for cmd in d.client.pkg.commands|unique %}
9 |
10 | kubernetes-client-alternatives-remove-bin-{{ cmd }}:
11 | alternatives.remove:
12 | - name: link-k8s-client-{{ cmd }}
13 | - path: {{ d.client.pkg.path }}/bin/{{ cmd }}
14 | - onlyif:
15 | - update-alternatives --list |grep ^link-k8s-client-{{ cmd }}
16 |
17 | {%- endfor %}
18 | {%- endif %}
19 |
--------------------------------------------------------------------------------
/kubernetes/client/alternatives/init.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .install
6 |
--------------------------------------------------------------------------------
/kubernetes/client/alternatives/install.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- if d.linux.altpriority|int > 0 and grains.kernel == 'Linux' and grains.os_family not in ('Arch',) %}
8 | {%- set sls_archive_install = tplroot ~ '.client.archive.install' %}
9 | {%- set sls_binary_install = tplroot ~ '.client.binary.install' %}
10 |
11 | include:
12 | - {{ sls_archive_install }}
13 | - {{ sls_binary_install }}
14 |
15 | {%- for cmd in d.client.pkg.commands|unique %}
16 |
17 | kubernetes-client-alternatives-install-bin-{{ cmd }}:
18 | {%- if grains.os_family not in ('Suse', 'Arch') %}
19 | alternatives.install:
20 | - name: link-k8s-client-{{ cmd }}
21 | - link: /usr/local/bin/{{ cmd }}
22 | - order: 10
23 | - path: {{ d.client['pkg']['path'] }}/bin/{{ cmd }}
24 | - priority: {{ d.linux.altpriority }}
25 | {%- else %}
26 | cmd.run:
27 | - name: update-alternatives --install /usr/local/bin/{{ cmd }} link-k8s-client-{{ cmd }} {{ d.client['pkg']['path'] }}/bin/{{ cmd }} {{ d.linux.altpriority }} # noqa 204
28 | {%- endif %}
29 |
30 | - onlyif:
31 | - test -f {{ d.client['pkg']['path'] }}/bin/{{ cmd }}
32 | - unless:
33 | - update-alternatives --list |grep ^link-k8s-client-{{ cmd }} || false
34 | - update-alternatives --list |grep "^link-k8s-server-{{ cmd }}" || false # avoid server clash
35 | - require:
36 | - sls: {{ sls_archive_install if d.client.pkg.use_upstream == 'archive' else sls_binary_install }}
37 | - require_in:
38 | - alternatives: kubernetes-client-alternatives-set-bin-{{ cmd }}
39 |
40 | kubernetes-client-alternatives-set-bin-{{ cmd }}:
41 | alternatives.set:
42 | - unless:
43 | - {{ grains.os_family in ('Suse', 'Arch') }} || false
44 | - update-alternatives --list |grep "^link-k8s-server-{{ cmd }}" || false # avoid server clash
45 | - name: link-k8s-client-{{ cmd }}
46 | - path: {{ d.client.pkg.path }}/bin/{{ cmd }}
47 | - onlyif:
48 | - test -f {{ d.client['pkg']['path'] }}/bin/{{ cmd }}
49 |
50 | {%- endfor %}
51 | {%- endif %}
52 |
--------------------------------------------------------------------------------
/kubernetes/client/archive/clean.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- set sls_alternatives_clean = tplroot ~ '.client.alternatives.clean' %}
8 | include:
9 | - {{ sls_alternatives_clean }}
10 |
11 | kubernetes-client-archive-absent:
12 | file.absent:
13 | - names:
14 | - {{ d.dir.tmp }}/client*
15 | - {{ d.client.pkg.path }}
16 | {%- if (d.linux.altpriority|int == 0 and grains.os != 'Windows') or grains.os_family in ('Arch', 'MacOS') %}
17 | {%- for cmd in d.client.pkg.commands|unique %}
18 | - /usr/local/bin/{{ cmd }}
19 | {%- endfor %}
20 | {%- endif %}
21 |
--------------------------------------------------------------------------------
/kubernetes/client/archive/init.sls:
--------------------------------------------------------------------------------
1 | #.-*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .install
6 |
--------------------------------------------------------------------------------
/kubernetes/client/archive/install.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- if grains.kernel|lower in ('linux', 'darwin', 'windows') %}
8 | {%- from tplroot ~ "/files/macros.jinja" import format_kwargs with context %}
9 | {%- if d.client.pkg.use_upstream == 'archive' and 'pkg' in d.client and 'archive' in d.client['pkg'] %}
10 |
11 | kubernetes-client-archive-install:
12 | {%- if grains.os|lower != 'windows' %}
13 | pkg.installed:
14 | - names: {{ d.pkg.deps|json }}
15 | - require_in:
16 | - file: kubernetes-client-archive-install
17 | {%- endif %}
18 | file.directory:
19 | - name: {{ d.client.pkg.path }}
20 | - makedirs: True
21 | - clean: {{ d.clean }}
22 | - require_in:
23 | - archive: kubernetes-client-archive-install
24 | {%- if grains.os|lower != 'windows' %}
25 | - mode: 755
26 | - user: {{ d.identity.rootuser }}
27 | - group: {{ d.identity.rootgroup }}
28 | - recurse:
29 | - user
30 | - group
31 | - mode
32 | {%- endif %}
33 | archive.extracted:
34 | {{- format_kwargs(d.client['pkg']['archive']) }}
35 | - retry: {{ d.retry_option|json }}
36 | - enforce_toplevel: false
37 | - trim_output: true
38 | - force: true
39 | - require:
40 | - file: kubernetes-client-archive-install
41 | {%- if grains.os|lower != 'windows' %}
42 | - user: {{ d.identity.rootuser }}
43 | - group: {{ d.identity.rootgroup }}
44 | - recurse:
45 | - user
46 | - group
47 |
48 | {%- if d.linux.altpriority|int == 0 or grains.os_family in ('Arch', 'MacOS') %}
49 | {%- for cmd in d.client.pkg.commands|unique %}
50 |
51 | kubernetes-client-archive-install-symlink-{{ cmd }}:
52 | file.symlink:
53 | - name: /usr/local/bin/{{ cmd }}
54 | - target: {{ d.client.pkg.path }}/bin/{{ cmd }}
55 | - force: True
56 | - onlyif: test -x {{ d.client.pkg.path }}/bin/{{ cmd }}
57 | - require:
58 | - archive: kubernetes-client-archive-install
59 |
60 | {%- endfor %}
61 | {%- endif %}
62 | {%- endif %}
63 | {%- if grains.os|lower == 'windows' %}
64 |
65 | kubernetes-client-archive-install-bashrc:
66 | file.replace:
67 | - name: C:\cygwin64\home\{{ d.identity.rootuser }}\.bashrc
68 | - pattern: '^export PATH=${PATH}:/cygdrive/c/kubernetes/bin$'
69 | - repl: 'export PATH=${PATH}:/cygdrive/c/kubernetes/bin'
70 | - append_if_not_found: True
71 | cmd.run:
72 | - name: sed -i -e "s/\r//g" C:\cygwin64\home\{{ d.identity.rootuser }}\.bashrc
73 | - onchanges:
74 | - file: kubernetes-client-archive-install-bashrc
75 |
76 | {%- endif %}
77 | {%- endif %}
78 | {%- else %}
79 |
80 | kubernetes-client-archive-install-other:
81 | test.show_notification:
82 | - text: |
83 | The client archive is unavailable for {{ salt['grains.get']('finger', grains.os_family) }}
84 |
85 | {%- endif %}
86 |
--------------------------------------------------------------------------------
/kubernetes/client/binary/clean.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | kubernetes-client-binary-clean:
8 | file.absent:
9 | - names:
10 | - /usr/local/bin/kubectl
11 | - {{ d.client.pkg.path }}
12 |
--------------------------------------------------------------------------------
/kubernetes/client/binary/init.sls:
--------------------------------------------------------------------------------
1 | #.-*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .install
6 |
--------------------------------------------------------------------------------
/kubernetes/client/binary/install.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- if d.client.pkg.use_upstream == 'binary' %}
8 |
9 | kubernetes-client-binary-install:
10 | {%- if grains.os|lower != 'windows' %}
11 | pkg.installed:
12 | - names: {{ d.pkg.deps|json }}
13 | - require_in:
14 | - file: kubernetes-client-binary-install
15 | {%- endif %}
16 | file.managed:
17 | - name: {{ d.client.pkg.path }}
18 | - source: {{ d.client.pkg.binary.source }}
19 | {%- if 'source_hash' in d.client.pkg.binary and d.client.pkg.binary.source_hash %}
20 | - source_hash: {{ p[tool]['binary']['source_hash'] }}
21 | {%- else %}
22 | - skip_verify: True
23 | {%- endif %}
24 | - makedirs: True
25 | - retry: {{ d.retry_option|json }}
26 | {%- if grains.os|lower != 'windows' %}
27 | - mode: '0755'
28 | - user: {{ d.identity.rootuser }}
29 | - group: {{ d.identity.rootgroup }}
30 |
31 | kubernetes-client-binary-install-symlink:
32 | file.symlink:
33 | - name: /usr/local/bin/kubectl
34 | - target: {{ d.client.pkg.path }}/bin/kubectl
35 | - force: True
36 | - require:
37 | - cmd: kubernetes-client-binary-install
38 | - unless: {{ d.linux.altpriority|int > 0 }} || false
39 |
40 | {%- elif grains.os|lower == 'windows' %}
41 |
42 | kubernetes-client-binary-install-bashrc:
43 | file.replace:
44 | - name: C:\cygwin64\home\{{ d.identity.rootuser }}\.bashrc
45 | - pattern: '^export PATH=${PATH}:/cygdrive/c/kubernetes/bin$'
46 | - repl: 'export PATH=${PATH}:/cygdrive/c/kubernetes/bin'
47 | - append_if_not_found: True
48 | cmd.run:
49 | - name: sed -i -e "s/\r//g" C:\cygwin64\home\{{ d.identity.rootuser }}\.bashrc
50 | - onchanges:
51 | - file: kubernetes-client-binary-install-bashrc
52 |
53 | {%- endif %}
54 | {%- endif %}
55 |
--------------------------------------------------------------------------------
/kubernetes/client/clean.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .package.clean
6 | - .binary.clean
7 | - .aliases.clean
8 | - .alternatives.clean
9 |
--------------------------------------------------------------------------------
/kubernetes/client/init.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .archive.install
6 | - .package.install
7 | - .binary.install
8 | - .aliases
9 | - .alternatives
10 |
--------------------------------------------------------------------------------
/kubernetes/client/package/clean.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- if d.client.pkg.use_upstream in ('package', 'repo') %}
8 | {%- if grains.kernel|lower in ('linux',) %}
9 |
10 | {%- if d.client.pkg.use_upstream == 'repo' %}
11 | include:
12 | - .package.repo.clean
13 | {%- endif %}
14 |
15 | kubernetes-client-package-clean-pkg:
16 | pkg.removed:
17 | - name: kubectl
18 | - reload_modules: true
19 | {%- if d.client.pkg.use_upstream == 'repo' %}
20 | - require:
21 | - pkgrepo: kubernetes-package-repo-absent
22 | {%- endif %}
23 |
24 | {%- elif grains.os_family == 'MacOS' %}
25 |
26 | kubernetes-client-package-clean-brew:
27 | cmd.run:
28 | - name: /usr/local/bin/brew uninstall kubectl
29 | - runas: {{ d.identity.rootuser }}
30 | - onlyif:
31 | - test -x /usr/local/bin/brew
32 | - brew list | grep ^kubectl$
33 |
34 | {%- elif grains.os_family == 'Windows' %}
35 |
36 | kubernetes-client-package-clean-choco:
37 | chocolatey.uninstalled:
38 | - name: {{ d.client.pkg.name }}
39 |
40 | {%- endif %}
41 | {%- endif %}
42 |
--------------------------------------------------------------------------------
/kubernetes/client/package/init.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .install
6 |
--------------------------------------------------------------------------------
/kubernetes/client/package/install.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- if d.client.pkg.use_upstream in ('package', 'repo') %}
8 |
9 | {%- if grains.kernel|lower in ('linux',) %}
10 | {%- if d.client.pkg.use_upstream == 'repo' %}
11 | include:
12 | - .package.repo.install
13 | {%- endif %}
14 |
15 | kubernetes-client-package-install-deps:
16 | pkg.installed:
17 | - names: {{ d.pkg.deps|json }}
18 | - require_in:
19 | - pkg: kubernetes-client-package-install-pkg
20 |
21 | kubernetes-client-package-install-pkg:
22 | pkg.installed:
23 | - name: {{ d.client.pkg.name }}
24 | - runas: {{ d.identity.rootuser }}
25 | - reload_modules: true
26 | {%- if d.client.pkg.use_upstream == 'repo' %}
27 | - require:
28 | - pkgrepo: kubernetes-package-repo-managed
29 | {%- endif %}
30 |
31 | {%- elif grains.kernel|lower in ('MacOS',) %}
32 |
33 | kubernetes-client-package-install-brew:
34 | cmd.run:
35 | - name: /usr/local/bin/brew install {{ d.client.pkg.name }}
36 | - runas: {{ d.identity.rootuser }}
37 | - onlyif:
38 | - test -x /usr/local/bin/brew
39 |
40 | kubernetes-client-package-reinstall-brew:
41 | cmd.run:
42 | - name: /usr/local/bin/brew reinstall kubectl
43 | - runas: {{ d.identity.rootuser }}
44 | - unless: test -x /usr/local/bin/kubectl # if binary is missing
45 |
46 | {%- elif grains.kernel|lower in ('windows',) %}
47 |
48 | kubernetes-client-package-install-choco:
49 | chocolatey.installed:
50 | - name: {{ d.client.pkg.name }}
51 | - force: True
52 |
53 | {%- endif %}
54 | {%- endif %}
55 |
--------------------------------------------------------------------------------
/kubernetes/cpuarchmap.yaml:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=yaml
3 | #
4 | # Setup variables using grains['cuparch'] based logic.
5 | # You just need to add the key:values for an `osarch` that differ
6 | # from `defaults.yaml` + `os_family.yaml`.
7 | # Only add an `cpuarch` which is/will be supported by the formula
8 | #
9 | # If you do not need to provide defaults via the `cpuarch` grain,
10 | # you will need to provide at least an empty dict in this file, e.g.
11 | # cpuarch: {}
12 | ---
13 | # Windows has no 'osarch' grain
14 | Default:
15 | dingdong: null
16 |
17 | AMD64:
18 | arch: amd64
19 |
--------------------------------------------------------------------------------
/kubernetes/crimgr/alternatives/clean.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- if d.linux.altpriority|int > 0 and grains.kernel == 'Linux' and grains.os_family not in ('Arch',) %}
8 | {%- if 'wanted' in d.crimgr and d.crimgr.wanted and d.crimgr['pkg'] %}
9 | {%- for cmd in d.crimgr['pkg']['commands']|unique %}
10 |
11 | kubernetes-cri-resource-manager-alternatives-clean-{{ cmd }}:
12 | alternatives.remove:
13 | - name: link-k8s-cri-resource-manager-{{ cmd }}
14 | - path: {{ d.crimgr.pkg['path'] }}/bin/{{ cmd }}
15 | - onlyif:
16 | - update-alternatives --list |grep ^link-k8s-cri-resource-manager-{{ cmd }}
17 |
18 | {%- endfor %}
19 | {%- endif %}
20 | {%- endif %}
21 |
--------------------------------------------------------------------------------
/kubernetes/crimgr/alternatives/init.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .install
6 |
--------------------------------------------------------------------------------
/kubernetes/crimgr/alternatives/install.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- if d.linux.altpriority|int > 0 and grains.kernel == 'Linux' and grains.os_family not in ('Arch',) %}
8 | {%- set sls_archive_install = tplroot ~ '.crimgr.archive.install' %}
9 |
10 | include:
11 | - {{ sls_archive_install }}
12 |
13 | {%- if 'wanted' in d.crimgr and d.crimgr.wanted and 'pkg' in d.crimgr and d.crimgr['pkg'] %}
14 | {%- for cmd in d.crimgr['pkg']['commands']|unique %}
15 |
16 | kubernetes-cri-resource-manager-alternatives-install-bin-{{ cmd }}:
17 | {%- if grains.os_family in ('Suse', 'Arch') %}
18 | alternatives.install:
19 | - name: link-k8s-cri-resource-manager-{{ cmd }}
20 | - link: /usr/local/bin/{{ cmd }}
21 | - order: 10
22 | - path: {{ d.crimgr.pkg['path'] }}/bin/{{ cmd }}
23 | - priority: {{ d.linux.altpriority }}
24 | {%- else %}
25 | cmd.run:
26 | - name: update-alternatives --install /usr/local/bin/{{ cmd }} link-k8s-cri-resource-manager-{{ cmd }} {{ d.crimgr.pkg['path'] }}/bin/{{ cmd }} {{ d.linux.altpriority }} # noqa 204
27 | {%- endif %}
28 |
29 | - onlyif:
30 | - test -f {{ d.crimgr.pkg['path'] }}/bin/{{ cmd }}
31 | - unless: update-alternatives --list |grep ^link-k8s-cri-resource-manager-{{ cmd }} || false
32 | - require:
33 | - sls: {{ sls_archive_install }}
34 | - require_in:
35 | - alternatives: kubernetes-cri-resource-manager-alternatives-set-bin-{{ cmd }}
36 |
37 | kubernetes-cri-resource-manager-alternatives-set-bin-{{ cmd }}:
38 | alternatives.set:
39 | - unless: {{ grains.os_family in ('Suse', 'Arch') }} || false
40 | - name: link-k8s-cri-resource-manager-{{ cmd }}
41 | - path: {{ d.crimgr.pkg['path'] }}/bin/{{ cmd }}
42 | - onlyif:
43 | - test -f {{ d.crimgr.pkg['path'] }}/bin/{{ cmd }}
44 |
45 | {%- endfor %}
46 | {%- endif %}
47 | {%- endif %}
48 |
--------------------------------------------------------------------------------
/kubernetes/crimgr/archive/clean.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- if grains.kernel|lower == 'linux' %}
8 | {%- if 'pkg' in d.crimgr and d.crimgr.pkg %}
9 |
10 | kubernetes-cri-resource-manager-archive-clean:
11 | file.absent:
12 | - names:
13 | # warning: don't list 'd.crimgr.pkg['path']' here (/)
14 | - /usr/local/etc/cri-resmgr
15 | - /usr/local/etc/default/cri-resource-manager
16 | - /usr/local/etc/systemd/system/cri-resource-manager.service
17 | - /usr/local/etc/default/cri-resource-manager
18 | - /usr/local/opt/intel/bin/cri-resmgr
19 | - /usr/local/opt/intel/share/doc/cri-resource-manager/
20 | - /usr/local/opt/intel/share/doc/cri-resource-manager/security.md
21 | - /usr/local/opt/intel/share/doc/cri-resource-manager/LICENSE
22 |
23 | {% endif %}
24 | {%- else %}
25 |
26 | kubernetes-cri-resource-manager-archive-clean-other:
27 | test.show_notification:
28 | - text: |
29 | The cri-resource-manager archive is unavailable for {{ salt['grains.get']('finger', grains.os_family) }}
30 |
31 | {%- endif %}
32 |
--------------------------------------------------------------------------------
/kubernetes/crimgr/archive/init.sls:
--------------------------------------------------------------------------------
1 | #.-*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .install
6 |
--------------------------------------------------------------------------------
/kubernetes/crimgr/archive/install.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 | {%- from tplroot ~ "/files/macros.jinja" import format_kwargs with context %}
7 |
8 | {%- if grains.kernel|lower == 'linux' %}
9 | {%- if d.crimgr.pkg and d.crimgr.pkg['use_upstream'] == 'archive' and 'archive' in d.crimgr.pkg %}
10 |
11 | kubernetes-cri-resource-manager-archive-install:
12 | archive.extracted:
13 | {{- format_kwargs(d.crimgr.pkg['archive']) }}
14 | - retry: {{ d.retry_option }}
15 | - enforce_toplevel: false
16 | - trim_output: true
17 | - user: {{ d.identity.rootuser }}
18 | - group: {{ d.identity.rootgroup }}
19 | - recurse:
20 | - user
21 | - group
22 |
23 | {%- else %}
24 |
25 | kubernetes-cri-resource-manager-archive-install-nothing:
26 | test.show_notification:
27 | - text: |
28 | The cri-resource-manager archive is not defined so skipping.
29 |
30 | {%- endif %}
31 | {%- else %}
32 |
33 | kubernetes-cri-resource-manager-archive-install-other:
34 | test.show_notification:
35 | - text: |
36 | The cri-resource-manager archive is unavailable for {{ salt['grains.get']('finger', grains.os_family) }}
37 |
38 | {%- endif %}
39 |
--------------------------------------------------------------------------------
/kubernetes/crimgr/clean.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .archive.clean
6 | - .alternatives.clean
7 |
--------------------------------------------------------------------------------
/kubernetes/crimgr/config/clean.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 | {%- set sls_archive_clean = tplroot ~ '.crimgr.archive.clean' %}
7 |
8 | include:
9 | - {{ sls_archive_clean }}
10 |
11 | kubernetes-crimgr-config-clean:
12 | file.absent:
13 | - names:
14 | - {{ d.crimgr.config_file }}
15 | - {{ d.crimgr.environ_file }}
16 | - require:
17 | - sls: {{ sls_archive_clean }}
18 |
--------------------------------------------------------------------------------
/kubernetes/crimgr/config/environ.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- if grains.kernel|lower == 'linux' and 'environ' in d.crimgr and d.crimgr.environ %}
8 | {%- from tplroot ~ "/libtofs.jinja" import files_switch with context %}
9 | {%- set sls_archive_install = tplroot ~ '.crimgr.archive.install' %}
10 |
11 | include:
12 | - {{ sls_archive_install }}
13 |
14 | kubernetes-crimgr-config-file-managed-environ_file:
15 | file.managed:
16 | - name: {{ d.crimgr.environ_file }}
17 | - source: {{ files_switch(['environ.sh.jinja'],
18 | lookup='k8s-crimgr-config-file-managed-environ_file'
19 | )
20 | }}
21 | - makedirs: True
22 | {%- if grains.os != 'Windows' %}
23 | - mode: '0640'
24 | - user: {{ d.identity.rootuser }}
25 | - group: {{ d.identity.rootgroup }}
26 | {%- endif %}
27 | - template: jinja
28 | - context:
29 | environ: {{ d.crimgr.environ|json }}
30 | - require:
31 | - sls: {{ sls_archive_install }}
32 |
33 | {%- endif %}
34 |
--------------------------------------------------------------------------------
/kubernetes/crimgr/config/file.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- if grains.kernel|lower == 'linux' and 'config' in d.crimgr and d.crimgr.config %}
8 | {%- from tplroot ~ "/libtofs.jinja" import files_switch with context %}
9 | {%- set sls_archive_install = tplroot ~ '.crimgr.archive.install' %}
10 |
11 | include:
12 | - {{ sls_archive_install }}
13 |
14 | kubernetes-crimgr-config-file-install-file-managed:
15 | file.managed:
16 | - name: {{ d.crimgr.config_file }}
17 | - source: {{ files_switch(['config.yml.jinja'],
18 | lookup='k8s-crimgr-config-file-install-file-managed'
19 | )
20 | }}
21 | - makedirs: True
22 | {%- if grains.os != 'Windows' %}
23 | - mode: 644
24 | - user: {{ d.identity.rootuser }}
25 | - group: {{ d.identity.rootgroup }}
26 | {%- endif %}
27 | - template: jinja
28 | - context:
29 | config: {{ d.crimgr.config|json }}
30 | - require:
31 | - sls: {{ sls_archive_install }}
32 |
33 | {%- endif %}
34 |
--------------------------------------------------------------------------------
/kubernetes/crimgr/config/init.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .file
6 | - .environ
7 |
--------------------------------------------------------------------------------
/kubernetes/crimgr/init.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .archive
6 | - .alternatives
7 |
--------------------------------------------------------------------------------
/kubernetes/devlibs/archive/clean.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- if 'wanted' in d.devlibs and d.devlibs.wanted %}
8 | {%- for tool in d.devlibs.wanted|unique %}
9 | {%- if 'pkg' in d.devlibs and tool in d.devlibs['pkg'] and d.devlibs['pkg'][tool] %}
10 |
11 | kubernetes-devlibs-archive-{{ tool }}-clean:
12 | file.absent:
13 | - names:
14 | - {{ d.devlibs['pkg'][tool]['path'] }}
15 |
16 | {% endif %}
17 | {%- endfor %}
18 | {%- endif %}
19 |
--------------------------------------------------------------------------------
/kubernetes/devlibs/archive/init.sls:
--------------------------------------------------------------------------------
1 | #.-*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .install
6 |
--------------------------------------------------------------------------------
/kubernetes/devlibs/archive/install.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 | {%- from tplroot ~ "/files/macros.jinja" import format_kwargs with context %}
7 |
8 | {%- if 'wanted' in d.devlibs and d.devlibs.wanted %}
9 |
10 | {%- if grains.os != 'Windows' %}
11 | kubernetes-devlibs-pkg-deps-install:
12 | pkg.installed:
13 | - names: {{ d.pkg.deps|json }}
14 | {%- endif %}
15 |
16 | {%- for tool in d.devlibs.wanted|unique %}
17 | {%- if 'pkg' in d.devlibs and tool in d.devlibs['pkg'] and d.devlibs['pkg'][tool] %}
18 | {%- set p = d.devlibs.pkg[tool] %}
19 | {%- if p['use_upstream'] == 'archive' and 'archive' in p %}
20 |
21 | kubernetes-devlibs-archive-{{ tool }}-install:
22 | file.directory:
23 | - name: {{ p['path'] }}
24 | - clean: {{ d.clean }}
25 | - makedirs: True
26 | - require_in:
27 | - archive: kubernetes-devlibs-archive-{{ tool }}-install
28 | {%- if grains.os != 'Windows' %}
29 | - require:
30 | - pkg: kubernetes-devlibs-pkg-deps-install
31 | - mode: 755
32 | - user: {{ d.identity.rootuser }}
33 | - group: {{ d.identity.rootgroup }}
34 | - recurse:
35 | - user
36 | - group
37 | - mode
38 | {%- endif %}
39 | archive.extracted:
40 | {{- format_kwargs(p['archive']) }}
41 | - retry: {{ d.retry_option }}
42 | - enforce_toplevel: false
43 | - trim_output: true
44 | {%- if grains.os != 'Windows' %}
45 | - user: {{ d.identity.rootuser }}
46 | - group: {{ d.identity.rootgroup }}
47 | - recurse:
48 | - user
49 | - group
50 | - mode
51 | {%- endif %}
52 | {% endif %}
53 | {% endif %}
54 | {%- endfor %}
55 | {%- endif %}
56 |
--------------------------------------------------------------------------------
/kubernetes/devlibs/clean.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .archive.clean
6 |
--------------------------------------------------------------------------------
/kubernetes/devlibs/init.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .archive
6 |
--------------------------------------------------------------------------------
/kubernetes/devtools/alternatives/clean.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- if d.linux.altpriority|int > 0 and grains.kernel == 'Linux' and grains.os_family not in ('Arch',) %}
8 | {%- if 'wanted' in d.devtools and d.devtools.wanted %}
9 | {%- for tool in d.devtools.wanted|unique %}
10 | {%- if 'pkg' in d.devtools and tool in d.devtools['pkg'] and d.devtools['pkg'][tool] %}
11 | {%- for cmd in d.devtools['pkg'][tool]['commands']|unique %}
12 |
13 | kubernetes-devtools-{{ tool }}-alternatives-clean-{{ cmd }}:
14 | alternatives.remove:
15 | - name: link-k8s-devtools-{{ tool }}-{{ cmd }}
16 | - path: {{ d.devtools['pkg'][tool]['path'] }}/{{ cmd }}
17 | - onlyif:
18 | - update-alternatives --list |grep ^link-k8s-devtools-{{ tool }}-{{ cmd }}
19 |
20 | {%- endfor %}
21 | {%- endif %}
22 | {%- endfor %}
23 | {%- endif %}
24 | {%- endif %}
25 |
--------------------------------------------------------------------------------
/kubernetes/devtools/alternatives/init.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .install
6 |
--------------------------------------------------------------------------------
/kubernetes/devtools/alternatives/install.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- if d.linux.altpriority|int > 0 and grains.kernel == 'Linux' and grains.os_family not in ('Arch',) %}
8 | {%- set sls_archive_install = tplroot ~ '.devtools.archive.install' %}
9 | {%- set sls_binary_install = tplroot ~ '.devtools.binary.install' %}
10 |
11 | include:
12 | - {{ sls_archive_install }}
13 | - {{ sls_binary_install }}
14 |
15 | {%- if 'wanted' in d.devtools and d.devtools.wanted %}
16 | {%- for tool in d.devtools.wanted|unique %}
17 | {%- if 'pkg' in d.devtools and tool in d.devtools['pkg'] and d.devtools['pkg'][tool] %}
18 | {%- for cmd in d.devtools['pkg'][tool]['commands']|unique %}
19 |
20 | kubernetes-devtools-{{ tool }}-alternatives-install-bin-{{ cmd }}:
21 | {%- if grains.os_family in ('Suse', 'Arch') %}
22 | alternatives.install:
23 | - name: link-k8s-devtools-{{ tool }}-{{ cmd }}
24 | - link: /usr/local/bin/{{ cmd }}
25 | - order: 10
26 | - path: {{ d.devtools['pkg'][tool]['path'] }}/{{ cmd }}
27 | - priority: {{ d.linux.altpriority }}
28 | {%- else %}
29 | cmd.run:
30 | - name: update-alternatives --install /usr/local/bin/{{ cmd }} link-k8s-devtools-{{ tool }}-{{ cmd }} {{ d.devtools['pkg'][tool]['path'] }}/{{ cmd }} {{ d.linux.altpriority }} # noqa 204
31 | {%- endif %}
32 |
33 | - onlyif:
34 | - test -f {{ d.devtools['pkg'][tool]['path'] }}/{{ cmd }}
35 | - unless: update-alternatives --list |grep ^link-k8s-devtools-{{ tool }}-{{ cmd }} || false
36 | - require:
37 | - sls: {{ sls_archive_install if d.devtools.pkg[tool]['use_upstream'] == 'archive' else sls_binary_install }}
38 | - require_in:
39 | - alternatives: kubernetes-devtools-{{ tool }}-alternatives-set-bin-{{ cmd }}
40 |
41 | kubernetes-devtools-{{ tool }}-alternatives-set-bin-{{ cmd }}:
42 | alternatives.set:
43 | - unless: {{ grains.os_family in ('Suse', 'Arch') }} || false
44 | - name: link-k8s-devtools-{{ tool }}-{{ cmd }}
45 | - path: {{ d.devtools['pkg'][tool]['path'] }}/{{ cmd }}
46 | - onlyif:
47 | - test -f {{ d.devtools['pkg'][tool]['path'] }}/{{ cmd }}
48 |
49 | {%- endfor %}
50 | {%- endif %}
51 | {%- endfor %}
52 | {%- endif %}
53 | {%- endif %}
54 |
--------------------------------------------------------------------------------
/kubernetes/devtools/archive/clean.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- if 'wanted' in d.devtools and d.devtools.wanted %}
8 | {%- for tool in d.devtools.wanted|unique %}
9 | {%- if 'pkg' in d.devtools and tool in d.devtools['pkg'] and d.devtools.pkg[tool] %}
10 |
11 | kubernetes-devtools-archive-{{ tool }}-clean:
12 | file.absent:
13 | - names:
14 | - "{{ d.devtools['pkg'][tool]['path'] }}"
15 | {%- for cmd in d.devtools['pkg'][tool]['commands']|unique %}
16 | - /usr/local/bin/{{ cmd }}
17 | {%- endfor %}
18 | module.run:
19 | - name: file.find
20 | - path: "{{ d.dir.base }}"
21 | - kwargs:
22 | iname: "k8s-devtools-{{ tool }}*"
23 | delete: "d"
24 |
25 | {% endif %}
26 | {%- endfor %}
27 | {%- endif %}
28 |
--------------------------------------------------------------------------------
/kubernetes/devtools/archive/init.sls:
--------------------------------------------------------------------------------
1 | #.-*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .install
6 |
--------------------------------------------------------------------------------
/kubernetes/devtools/archive/install.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 | {%- from tplroot ~ "/files/macros.jinja" import format_kwargs with context %}
7 |
8 | {%- if 'wanted' in d.devtools and d.devtools.wanted %}
9 |
10 | {%- if grains.os != 'Windows' %}
11 | kubernetes-devtools-pkg-deps-install:
12 | pkg.installed:
13 | - names: {{ d.pkg.deps|json }}
14 | {%- endif %}
15 |
16 | {%- for tool in d.devtools.wanted|unique %}
17 | {%- if 'pkg' in d.devtools and tool in d.devtools['pkg'] and d.devtools['pkg'][tool] %}
18 | {%- set p = d.devtools.pkg[tool] %}
19 | {%- if p['use_upstream'] == 'archive' and 'archive' in p %}
20 |
21 | kubernetes-devtools-archive-{{ tool }}-install:
22 | file.directory:
23 | - name: {{ d.devtools['pkg'][tool]['path'] }}
24 | - clean: {{ d.clean }}
25 | - makedirs: True
26 | - require_in:
27 | - archive: kubernetes-devtools-archive-{{ tool }}-install
28 | {%- if grains.os != 'Windows' %}
29 | - require:
30 | - pkg: kubernetes-devtools-pkg-deps-install
31 | - mode: 755
32 | - user: {{ d.identity.rootuser }}
33 | - group: {{ d.identity.rootgroup }}
34 | - recurse:
35 | - user
36 | - group
37 | - mode
38 | {%- endif %}
39 | archive.extracted:
40 | {{- format_kwargs(d.devtools['pkg'][tool]['archive']) }}
41 | - retry: {{ d.retry_option }}
42 | - enforce_toplevel: false
43 | - trim_output: true
44 | {%- if grains.os != 'Windows' %}
45 | - user: {{ d.identity.rootuser }}
46 | - group: {{ d.identity.rootgroup }}
47 | - recurse:
48 | - user
49 | - group
50 | {%- else %}
51 | {%- if tool in ('devspace', 'k3s', 'kind', 'linkerd2', 'minikube', 'skaffold', 'stern') %}
52 | cmd.run:
53 | - name: mv {{ d.dir.base ~ d.div ~ 'bin' ~ d.div }}{{ tool }} {{ d.dir.base ~ d.div ~ 'bin' ~ d.div }}{{ tool }}.exe
54 | - onlyif: test -f {{ d.dir.base ~ d.div ~ 'bin' ~ d.div }}{{ tool }}
55 |
56 | {%- endif %}
57 | {%- if d.linux.altpriority|int == 0 or grains.os_family in ('Arch', 'MacOS') %}
58 | {%- for cmd in d.devtools['pkg'][tool]['commands']|unique %}
59 |
60 | kubernetes-devtools-archive-{{ tool }}-install-symlink-{{ cmd }}:
61 | file.symlink:
62 | - name: /usr/local/bin/{{ cmd }}
63 | - target: {{ d.devtools['pkg'][tool]['path'] }}/bin/{{ cmd }}
64 | - force: True
65 | - onlyif:
66 | - test -f {{ d.devtools['pkg'][tool]['path'] }}/bin/{{ cmd }}
67 | - require:
68 | - archive: kubernetes-devtools-archive-{{ tool }}-install
69 |
70 | {%- endfor %}
71 | {%- endif %}
72 | {%- endif %}
73 | {%- endif %}
74 | {%- endif %}
75 | {%- endfor %}
76 | {%- if grains.os == 'Windows' %}
77 |
78 | kubernetes-devtools-archive-install-bashrc:
79 | file.replace:
80 | - name: C:\cygwin64\home\{{ d.identity.rootuser }}\.bashrc
81 | - pattern: '^export PATH=${PATH}:/cygdrive/c/kubernetes/bin$'
82 | - repl: 'export PATH=${PATH}:/cygdrive/c/kubernetes/bin'
83 | - append_if_not_found: True
84 | cmd.run:
85 | - name: sed -i -e "s/\r//g" C:\cygwin64\home\{{ d.identity.rootuser }}\.bashrc
86 | - onchanges:
87 | - file: kubernetes-devtools-archive-install-bashrc
88 |
89 | kubernetes-devtools-archive-install-windows-tidyup:
90 | cmd.run:
91 | - names:
92 | - mv {{ d.dir.base ~ d.div }}istio-{{ d.devtools.pkg.istio.version }}{{ d.div ~ 'bin' ~ d.div }}istioctl {{ d.dir.base ~ d.div ~ 'bin' ~ d.div }} || True # noqa 204
93 | - mv {{ d.dir.base ~ d.div }}octant_{{ d.devtools.pkg.octant.version }}_Windows-64Bit{{ d.div }}octant {{ d.dir.base ~ d.div ~ 'bin' ~ d.div }} || True # noqa 204
94 | file.absent:
95 | - names:
96 | - {{ d.dir.base ~ d.div ~ 'bin' ~ d.div }}/doc
97 | - {{ d.dir.base ~ d.div ~ 'bin' ~ d.div }}/README.md
98 | - {{ d.dir.base ~ d.div ~ 'bin' ~ d.div }}/LICENSE
99 | - {{ d.dir.base ~ d.div ~ 'bin' ~ d.div }}istio-{{ d.devtools.pkg.istio.version }}
100 | - {{ d.dir.base ~ d.div ~ 'bin' ~ d.div }}octant_{{ d.devtools.pkg.octant.version }}_Windows-64Bit
101 |
102 | {%- endif %}
103 | {%- endif %}
104 |
--------------------------------------------------------------------------------
/kubernetes/devtools/binary/clean.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- if 'wanted' in d.devtools and d.devtools.wanted %}
8 | {%- for tool in d.devtools.wanted|unique %}
9 | {%- if d.devtools.pkg[tool]['use_upstream'] == 'binary' %}
10 | {%- if 'pkg' in d.devtools and tool in d.devtools['pkg'] and d.devtools['pkg'][tool] %}
11 |
12 | kubernetes-devtools-binary-{{ tool }}-clean:
13 | file.absent:
14 | - names:
15 | - {{ d.devtools['pkg'][tool]['path'] }}
16 | {%- for cmd in d.devtools['pkg'][tool]['commands']|unique %}
17 | - /usr/local/bin/{{ cmd }}
18 | {%- endfor %}
19 | module.run:
20 | - name: file.find
21 | - path: "{{ d.dir.base }}"
22 | - kwargs:
23 | iname: "k8s-devtools-{{ tool }}*"
24 | delete: "d"
25 |
26 | {% endif %}
27 | {% endif %}
28 | {%- endfor %}
29 | {%- endif %}
30 |
--------------------------------------------------------------------------------
/kubernetes/devtools/binary/init.sls:
--------------------------------------------------------------------------------
1 | #.-*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .install
6 |
--------------------------------------------------------------------------------
/kubernetes/devtools/binary/install.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- if 'wanted' in d.devtools and d.devtools.wanted %}
8 | {%- for tool in d.devtools.wanted|unique %}
9 | {%- if d.devtools.pkg[tool]['use_upstream'] == 'binary' %}
10 | {%- set p = d.devtools['pkg'] %}
11 | {%- if 'binary' in p[tool] and 'source' in p[tool]['binary'] %}
12 |
13 | kubernetes-devtools-binary-{{ tool }}-install:
14 | file.managed:
15 | - name: {{ p[tool]['path'] }}{{ tool }}
16 | - source: {{ p[tool]['binary']['source'] }}
17 | {%- if 'source_hash' in p[tool]['binary'] and p[tool]['binary']['source_hash'] %}
18 | - source_hash: {{ p[tool]['binary']['source_hash'] }}
19 | {%- else %}
20 | - skip_verify: True
21 | {%- endif %}
22 | - makedirs: True
23 | - force: True
24 | - retry: {{ d.retry_option|json }}
25 | {%- if grains.os|lower == 'windows' %}
26 | {%- if tool in ('devspace', 'k3s', 'kind', 'linkerd2', 'minikube', 'skaffold', 'stern') %}
27 | cmd.run:
28 | - name: mv {{ d.dir.base ~ d.div ~ 'bin' ~ d.div }}{{ tool }} {{ d.dir.base ~ d.div ~ 'bin' ~ d.div }}{{ tool }}.exe
29 | - onlyif: test -f {{ d.dir.base ~ d.div ~ 'bin' ~ d.div }}{{ tool }}
30 | - unless: cmp {{ d.dir.base ~ d.div ~ 'bin' ~ d.div }}{{ tool }} {{ d.dir.base ~ d.div ~ 'bin' ~ d.div }}{{ tool }}.exe
31 | {%- endif %}
32 |
33 | {%- else %}
34 | - mode: '0755'
35 | - user: {{ d.identity.rootuser }}
36 | - group: {{ d.identity.rootgroup }}
37 |
38 | {%- if d.linux.altpriority|int == 0 or grains.os_family in ('Arch', 'MacOS') %}
39 | {%- for cmd in p[tool]['commands']|unique %}
40 |
41 | kubernetes-devtools-binary-{{ tool }}-install-symlink-{{ cmd }}:
42 | file.symlink:
43 | - name: /usr/local/bin/{{ cmd }}
44 | - target: {{ p[tool]['path'] }}{{ cmd }}
45 | - force: True
46 | - onlyif: test -x {{ p[tool]['path'] }}{{ cmd }}
47 | - require:
48 | - file: kubernetes-devtools-binary-{{ tool }}-install
49 | {%- endfor %}
50 | {%- endif %}
51 | {%- endif %}
52 | {%- endif %}
53 | {%- endif %}
54 | {%- endfor %}
55 | {%- if grains.os|lower == 'windows' %}
56 |
57 | kubernetes-devtools-binary-install-bashrc:
58 | file.replace:
59 | - name: C:\cygwin64\home\{{ d.identity.rootuser }}\.bashrc
60 | - pattern: '^export PATH=${PATH}:/cygdrive/c/kubernetes/bin$'
61 | - repl: 'export PATH=${PATH}:/cygdrive/c/kubernetes/bin'
62 | - append_if_not_found: True
63 | cmd.run:
64 | - name: sed -i -e "s/\r//g" C:\cygwin64\home\{{ d.identity.rootuser }}\.bashrc
65 | - onchanges:
66 | - file: kubernetes-devtools-binary-install-bashrc
67 |
68 | {%- endif %}
69 | {%- endif %}
70 |
--------------------------------------------------------------------------------
/kubernetes/devtools/clean.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .binary.clean
6 | - .archive.clean
7 | - .alternatives.clean
8 |
--------------------------------------------------------------------------------
/kubernetes/devtools/init.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .archive
6 | - .binary
7 | - .alternatives
8 |
--------------------------------------------------------------------------------
/kubernetes/files/default/config.yml.jinja:
--------------------------------------------------------------------------------
1 | ########################################################################
2 | # File managed by Salt at <{{ source }}>.
3 | # Your changes may be overwritten.
4 | ########################################################################
5 |
6 | {{ config|yaml(False) }}
7 |
--------------------------------------------------------------------------------
/kubernetes/files/default/environ.sh.jinja:
--------------------------------------------------------------------------------
1 | ########################################################################
2 | # File managed by Salt at <{{ source }}>.
3 | # Your changes may be overwritten.
4 | ########################################################################
5 |
6 | {{ environ|yaml(False) }}
7 |
--------------------------------------------------------------------------------
/kubernetes/files/macros.jinja:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=jinja
3 | #
4 | # Collection of common macros
5 |
6 | {%- macro format_kwargs(kwarg) -%}
7 |
8 | {%- filter indent(4) %}
9 | {%- for k, v in kwarg|dictsort() %}
10 | - {{ k }}: {{ v }}
11 | {%- endfor %}
12 | {%- endfilter %}
13 |
14 | {%- endmacro %}
15 |
--------------------------------------------------------------------------------
/kubernetes/init.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .client
6 | - .server
7 | - .node
8 | - .k3s
9 | - .operator
10 | - .operators
11 | - .devtools
12 | - .devlibs
13 | - .sigs
14 | - .crimgr
15 |
--------------------------------------------------------------------------------
/kubernetes/k3s/alternatives/clean.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- if d.linux.altpriority|int > 0 and grains.kernel == 'Linux' and grains.os_family not in ('Arch',) %}
8 | {%- for cmd in d.k3s['pkg']['commands']|unique %}
9 |
10 | kubernetes-k3s-alternatives-clean-{{ cmd }}:
11 | alternatives.remove:
12 | - name: link-k8s-k3s-{{ cmd }}
13 | - path: {{ d.k3s['pkg']['path'] }}/{{ cmd }}
14 | - onlyif:
15 | - update-alternatives --list |grep ^link-k8s-k3s-{{ cmd }}
16 |
17 | {%- endfor %}
18 | {%- endif %}
19 |
--------------------------------------------------------------------------------
/kubernetes/k3s/alternatives/init.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .install
6 |
--------------------------------------------------------------------------------
/kubernetes/k3s/alternatives/install.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- if d.linux.altpriority|int > 0 and grains.kernel == 'Linux' and grains.os_family not in ('Arch',) %}
8 | {%- set sls_script_install = tplroot ~ '.k3s.script.install' %}
9 | {%- set sls_binary_install = tplroot ~ '.k3s.binary.install' %}
10 |
11 | include:
12 | - {{ sls_script_install }}
13 | - {{ sls_binary_install }}
14 |
15 | {%- for cmd in d.k3s['pkg']['commands']|unique %}
16 |
17 | kubernetes-k3s-alternatives-install-bin-{{ cmd }}:
18 | {%- if grains.os_family in ('Suse', 'Arch') %}
19 | alternatives.install:
20 | - name: link-k8s-k3s-{{ cmd }}
21 | - link: /usr/local/bin/{{ cmd }}
22 | - order: 10
23 | - path: {{ d.k3s['pkg']['path'] }}/{{ cmd }}
24 | - priority: {{ d.linux.altpriority }}
25 | {%- else %}
26 | cmd.run:
27 | - name: update-alternatives --install /usr/local/bin/{{ cmd }} link-k8s-k3s-{{ cmd }} {{ d.k3s['pkg']['path'] }}/{{ cmd }} {{ d.linux.altpriority }} # noqa 204
28 | {%- endif %}
29 |
30 | - onlyif:
31 | - test -f {{ d.k3s['pkg']['path'] }}/{{ cmd }}
32 | - unless: update-alternatives --list |grep ^link-k8s-k3s-{{ cmd }} || false
33 | - require:
34 | - sls: {{ sls_script_install if d.k3s.pkg['use_upstream'] == 'script' else sls_binary_install }}
35 | - require_in:
36 | - alternatives: kubernetes-k3s-alternatives-set-bin-{{ cmd }}
37 |
38 | kubernetes-k3s-alternatives-set-bin-{{ cmd }}:
39 | alternatives.set:
40 | - unless: {{ grains.os_family in ('Suse', 'Arch') }} || false
41 | - name: link-k8s-k3s-{{ cmd }}
42 | - path: {{ d.k3s['pkg']['path'] }}/{{ cmd }}
43 | - onlyif: test -f {{ d.k3s['pkg']['path'] }}/{{ cmd }}
44 |
45 | {%- endfor %}
46 | {%- endif %}
47 |
--------------------------------------------------------------------------------
/kubernetes/k3s/binary/clean.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | kubernetes-k3s-binary-clean:
8 | file.absent:
9 | - names:
10 | - /usr/local/bin/k3s
11 | - "{{ d.k3s.pkg.path }}"
12 | module.run:
13 | - name: file.find
14 | - path: "{{ d.dir.base }}"
15 | - kwargs:
16 | iname: "k8s-k3s-v*"
17 | delete: "d"
18 |
--------------------------------------------------------------------------------
/kubernetes/k3s/binary/init.sls:
--------------------------------------------------------------------------------
1 | #.-*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .install
6 |
--------------------------------------------------------------------------------
/kubernetes/k3s/binary/install.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- if d.k3s.pkg.use_upstream == 'binary' %}
8 |
9 | kubernetes-k3s-binary-install:
10 | {%- if grains.os|lower != 'windows' %}
11 | pkg.installed:
12 | - names: {{ d.pkg.deps|json }}
13 | - require_in:
14 | - file: kubernetes-k3s-binary-install
15 | {%- endif %}
16 | file.managed:
17 | - name: {{ d.k3s.pkg.path }}k3s
18 | - source: {{ d.k3s.pkg.binary.source }}
19 | - source_hash: {{ d.k3s.pkg.binary.source_hash }}
20 | - makedirs: True
21 | - retry: {{ d.retry_option|json }}
22 | {%- if grains.os|lower != 'windows' %}
23 | - mode: 755
24 | - user: {{ d.identity.rootuser }}
25 | - group: {{ d.identity.rootgroup }}
26 |
27 | {%- if d.linux.altpriority|int == 0 or grains.os_family in ('Arch', 'MacOS') %}
28 | {%- for cmd in d.k3s.pkg['commands']|unique %}
29 |
30 | kubernetes-k3s-binary-install-symlink:
31 | file.symlink:
32 | - name: /usr/local/bin/k3s
33 | - target: {{ d.k3s.pkg.path }}/k3s
34 | - force: True
35 | - onlyif: test -x {{ d.k3s.pkg.path }}/k3s
36 | - require:
37 | - file: kubernetes-k3s-binary-install
38 | - unless: {{ d.linux.altpriority|int > 0 }} || false
39 |
40 | {%- endfor %}
41 | {%- endif %}
42 | {%- elif grains.os|lower == 'windows' %}
43 |
44 | cmd.run:
45 | - name: mv {{ d.k3s.pkg.path }}k3s {{ d.k3s.pkg.path }}k3s.exe
46 | - onlyif: test -f {{ d.k3s.pkg.path }}k3s
47 |
48 | kubernetes-k3s-archive-install-bashrc:
49 | file.replace:
50 | - name: C:\cygwin64\home\{{ d.identity.rootuser }}\.bashrc
51 | - pattern: '^export PATH=${PATH}:/cygdrive/c/kubernetes/bin$'
52 | - repl: 'export PATH=${PATH}:/cygdrive/c/kubernetes/bin'
53 | - append_if_not_found: True
54 | cmd.run:
55 | - name: sed -i -e "s/\r//g" C:\cygwin64\home\{{ d.identity.rootuser }}\.bashrc
56 | - onchanges:
57 | - file: kubernetes-k3s-archive-install-bashrc
58 |
59 | {%- endif %}
60 | {%- endif %}
61 |
--------------------------------------------------------------------------------
/kubernetes/k3s/clean.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .config.clean
6 | - .script.clean
7 | - .alternatives.clean
8 | - .binary.clean
9 |
--------------------------------------------------------------------------------
/kubernetes/k3s/config/clean.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- if 'config_file' in d.k3s and d.k3s.config_file %}
8 | {%- set sls_binary_clean = tplroot ~ '.k3s.binary.clean' %}
9 | {%- set sls_script_clean = tplroot ~ '.k3s.script.clean' %}
10 |
11 | include:
12 | - {{ sls_archive_clean if d.k3s.pkg.use_upstream == 'archive' else sls_script_clean }}
13 |
14 | kubernetes-k3s-config-clean:
15 | file.absent:
16 | - names:
17 | - {{ d.k3s.config_file }}
18 | - require:
19 | - sls: {{ sls_archive_clean if d.k3s.pkg.use_upstream == 'archive' else sls_script_clean }}
20 |
21 | {%- endif %}
22 |
--------------------------------------------------------------------------------
/kubernetes/k3s/config/file.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- if 'config' in d.k3s and d.k3s.config %}
8 | {%- set sls_archive_install = tplroot ~ '.k3s.archive.install' %}
9 | {%- set sls_binary_install = tplroot ~ '.k3s.binary.install' %}
10 | {%- set sls_package_install = tplroot ~ '.k3s.package.install' %}
11 | {%- from tplroot ~ "/libtofs.jinja" import files_switch with context %}
12 |
13 | include:
14 | - {{ sls_archive_install if d.k3s.pkg.use_upstream == 'archive' else sls_binary_install if d.k3s.pkg.use_upstream == 'binary' else sls_package_install }} # noqa 204
15 |
16 | kubernetes-k3s-config-file-install-file-managed:
17 | file.managed:
18 | - name: {{ d.k3s.config_file }}
19 | - source: {{ files_switch(['config.yml.jinja'],
20 | lookup='k8s-k3s-config-file-install-file-managed'
21 | )
22 | }}
23 | - makedirs: True
24 | {%- if grains.os != 'Windows' %}
25 | - mode: 644
26 | - user: {{ d.identity.rootuser }}
27 | - group: {{ d.identity.rootgroup }}
28 | {%- endif %}
29 | - template: jinja
30 | - context:
31 | config: {{ d.k3s.config|json }}
32 | - require:
33 | - sls: {{ sls_archive_install if d.k3s.pkg.use_upstream == 'archive' else sls_binary_install if d.k3s.pkg.use_upstream == 'binary' else sls_package_install }} # noqa 204
34 |
35 | {%- endif %}
36 |
--------------------------------------------------------------------------------
/kubernetes/k3s/config/init.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .file
6 |
--------------------------------------------------------------------------------
/kubernetes/k3s/init.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .script
6 | - .binary
7 | - .alternatives
8 | - .config
9 |
--------------------------------------------------------------------------------
/kubernetes/k3s/script/clean.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- if d.k3s.pkg.use_upstream == 'script' %}
8 | {%- if grains.os_family not in ('Redhat',) %}
9 |
10 | kubernetes-k3s-script-clean-killall:
11 | cmd.run:
12 | - name: {{ d.k3s.pkg.script.killall }}
13 | - onlyif:
14 | - test -f {{ d.k3s.pkg.script.killall }}
15 |
16 | kubernetes-k3s-script-clean-uninstall:
17 | cmd.run:
18 | - names:
19 | - sleep 15
20 | - {{ d.k3s.pkg.script.uninstall }}
21 | - onlyif:
22 | - test -f {{ d.k3s.pkg.script.uninstall }}
23 |
24 | kubernetes-k3s-script-clean-file-absent:
25 | file.absent:
26 | - names:
27 | - {{ d.dir.tmp }}
28 | - {{ d.k3s.pkg.script.killall }}
29 | - {{ d.k3s.pkg.script.uninstall }}
30 | - require:
31 | - cmd: kubernetes-k3s-script-clean-killall
32 | - cmd: kubernetes-k3s-script-clean-uninstall
33 |
34 | {%- else %}
35 |
36 | kubernetes-k3s-package-uninstall-other:
37 | test.show_notification:
38 | - text: |
39 | The k3s package is unavailable for {{ salt['grains.get']('finger', grains.os_family) }}
40 | RedHat is bugged
41 |
42 | {%- endif %}
43 | {%- endif %}
44 |
--------------------------------------------------------------------------------
/kubernetes/k3s/script/init.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import kubernetes as k8s with context %}
6 |
7 | include:
8 | - .install
9 |
--------------------------------------------------------------------------------
/kubernetes/k3s/script/install.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- if d.k3s.pkg.use_upstream == 'script' %}
8 |
9 | {%- if grains.os_family not in ('RedHat', 'Windows') %}
10 | kubernetes-k3s-script-install-prerequisites:
11 | pkg.installed:
12 | - names: {{ d.pkg.deps|json }}
13 | {%- if grains.os_family in ('CentOS',) and d.k3s.pkg.deps_url %}
14 | cmd.run:
15 | - names:
16 | {%- for pkg in d.pkg.deps_url %}
17 | - yum install -y {{ pkg }}
18 | {%- endfor %}
19 | - require_in:
20 | - file: kubernetes-k3s-script-install-prerequisites
21 | {%- endif %}
22 | file.directory:
23 | - name: {{ d.dir.tmp }}
24 | - makedirs: True
25 | - require:
26 | - pkg: kubernetes-k3s-script-install-prerequisites
27 | {%- if grains.os != 'Windows' %}
28 | - mode: '0755'
29 | - user: {{ d.identity.rootuser }}
30 | - group: {{ d.identity.rootgroup }}
31 | {%- endif %}
32 |
33 | kubernetes-k3s-script-download:
34 | file.managed:
35 | - name: {{ d.dir.tmp }}/k3s-bootstrap.sh
36 | - source: {{ d.k3s.pkg.script.source }}
37 | - source_hash: {{ d.k3s.pkg.script.source_hash }}
38 | - require:
39 | - file: kubernetes-k3s-script-install-prerequisites
40 | {%- if grains.os != 'Windows' %}
41 | - mode: 755
42 | - user: {{ d.identity.rootuser }}
43 | - group: {{ d.identity.rootgroup }}
44 | {%- endif %}
45 |
46 | kubernetes-k3s-script-download-clean:
47 | file.absent:
48 | - name: {{ d.dir.tmp }}/k3s-bootstrap.sh
49 | - onfail:
50 | - file: kubernetes-k3s-script-download
51 |
52 | kubernetes-k3s-script-install:
53 | cmd.run:
54 | - name: {{ d.dir.tmp }}/k3s-bootstrap.sh
55 | {%- if 'env' in d.k3s.pkg.script and d.k3s.pkg.script.env %}
56 | - env:
57 | {%- for k,v in d.k3s.pkg.script.env.items() %}
58 | - {{ k }}: {{ v }}
59 | {%- endfor %}
60 | {%- endif %}
61 | - require:
62 | - file: kubernetes-k3s-script-download
63 |
64 | {%- else %}
65 |
66 | kubernetes-k3s-package-install-other:
67 | test.show_notification:
68 | - text: |
69 | The k3s package is unavailable for {{ salt['grains.get']('finger', grains.os_family) }}
70 | RedHat is bugged
71 |
72 | {%- endif %}
73 | {%- endif %}
74 |
--------------------------------------------------------------------------------
/kubernetes/kubectl:
--------------------------------------------------------------------------------
1 | client
--------------------------------------------------------------------------------
/kubernetes/libtofs.jinja:
--------------------------------------------------------------------------------
1 | {%- macro files_switch(source_files,
2 | lookup=None,
3 | default_files_switch=['id', 'os_family'],
4 | indent_width=6,
5 | v1_path_prefix='') %}
6 | {#-
7 | Returns a valid value for the "source" parameter of a "file.managed"
8 | state function. This makes easier the usage of the Template Override and
9 | Files Switch (TOFS) pattern.
10 |
11 | Params:
12 | * source_files: ordered list of files to look for
13 | * lookup: key under ':tofs:source_files' to override
14 | list of source files
15 | * default_files_switch: if there's no config (e.g. pillar)
16 | ':tofs:files_switch' this is the ordered list of grains to
17 | use as selector switch of the directories under
18 | "/files"
19 | * indent_witdh: indentation of the result value to conform to YAML
20 | * v1_path_prefix: (deprecated) only used for injecting a path prefix into
21 | the source, to support older TOFS configs
22 |
23 | Example (based on a `tplroot` of `xxx`):
24 |
25 | If we have a state:
26 |
27 | Deploy configuration:
28 | file.managed:
29 | - name: /etc/yyy/zzz.conf
30 | - source: {{ files_switch(['/etc/yyy/zzz.conf', '/etc/yyy/zzz.conf.jinja'],
31 | lookup='Deploy configuration'
32 | ) }}
33 | - template: jinja
34 |
35 | In a minion with id=theminion and os_family=RedHat, it's going to be
36 | rendered as:
37 |
38 | Deploy configuration:
39 | file.managed:
40 | - name: /etc/yyy/zzz.conf
41 | - source:
42 | - salt://xxx/files/theminion/etc/yyy/zzz.conf
43 | - salt://xxx/files/theminion/etc/yyy/zzz.conf.jinja
44 | - salt://xxx/files/RedHat/etc/yyy/zzz.conf
45 | - salt://xxx/files/RedHat/etc/yyy/zzz.conf.jinja
46 | - salt://xxx/files/default/etc/yyy/zzz.conf
47 | - salt://xxx/files/default/etc/yyy/zzz.conf.jinja
48 | - template: jinja
49 | #}
50 | {#- Get the `tplroot` from `tpldir` #}
51 | {%- set tplroot = tpldir.split('/')[0] %}
52 | {%- set path_prefix = salt['config.get'](tplroot ~ ':tofs:path_prefix', tplroot) %}
53 | {%- set files_dir = salt['config.get'](tplroot ~ ':tofs:dirs:files', 'files') %}
54 | {%- set files_switch_list = salt['config.get'](
55 | tplroot ~ ':tofs:files_switch',
56 | default_files_switch
57 | ) %}
58 | {#- Lookup source_files (v2), files (v1), or fallback to source_files parameter #}
59 | {%- set src_files = salt['config.get'](
60 | tplroot ~ ':tofs:source_files:' ~ lookup,
61 | salt['config.get'](
62 | tplroot ~ ':tofs:files:' ~ lookup,
63 | source_files
64 | )
65 | ) %}
66 | {#- Only add to [''] when supporting older TOFS implementations #}
67 | {%- set path_prefix_exts = [''] %}
68 | {%- if v1_path_prefix != '' %}
69 | {%- do path_prefix_exts.append(v1_path_prefix) %}
70 | {%- endif %}
71 | {%- for path_prefix_ext in path_prefix_exts %}
72 | {%- set path_prefix_inc_ext = path_prefix ~ path_prefix_ext %}
73 | {#- For older TOFS implementation, use `files_switch` from the config #}
74 | {#- Use the default, new method otherwise #}
75 | {%- set fsl = salt['config.get'](
76 | tplroot ~ path_prefix_ext|replace('/', ':') ~ ':files_switch',
77 | files_switch_list
78 | ) %}
79 | {#- Append an empty value to evaluate as `default` in the loop below #}
80 | {%- if '' not in fsl %}
81 | {%- do fsl.append('') %}
82 | {%- endif %}
83 | {%- for fs in fsl %}
84 | {%- for src_file in src_files %}
85 | {%- if fs %}
86 | {%- set fs_dir = salt['config.get'](fs, fs) %}
87 | {%- else %}
88 | {%- set fs_dir = salt['config.get'](tplroot ~ ':tofs:dirs:default', 'default') %}
89 | {%- endif %}
90 | {%- set url = [
91 | '- salt:/',
92 | path_prefix_inc_ext.strip('/'),
93 | files_dir.strip('/'),
94 | fs_dir.strip('/'),
95 | src_file.strip('/'),
96 | ] | select | join('/') %}
97 | {{ url | indent(indent_width, true) }}
98 | {%- endfor %}
99 | {%- endfor %}
100 | {%- endfor %}
101 | {%- endmacro %}
102 |
--------------------------------------------------------------------------------
/kubernetes/node/alternatives/clean.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {% from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- if d.linux.altpriority|int > 0 and grains.kernel == 'Linux' and grains.os_family not in ('Arch',) %}
8 | {%- for cmd in d.node.pkg.commands|unique %}
9 |
10 | kubernetes-node-alternatives-clean-{{ cmd }}:
11 | alternatives.remove:
12 | - name: link-k8s-node-{{ cmd }}
13 | - path: {{ d.node.pkg.path }}/bin/{{ cmd }}
14 | - onlyif:
15 | - update-alternatives --list |grep ^link-k8s-node-{{ cmd }}
16 |
17 | {%- endfor %}
18 | {%- endif %}
19 |
--------------------------------------------------------------------------------
/kubernetes/node/alternatives/init.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .install
6 |
--------------------------------------------------------------------------------
/kubernetes/node/alternatives/install.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- if d.linux.altpriority|int > 0 and grains.kernel == 'Linux' and grains.os_family not in ('Arch',) %}
8 | {%- set sls_archive_install = tplroot ~ '.node.archive.install' %}
9 | {%- set sls_package_install = tplroot ~ '.node.package.install' %}
10 |
11 | include:
12 | - {{ sls_archive_install }}
13 | - {{ sls_package_install }}
14 |
15 | {%- for cmd in d.node.pkg.commands|unique %}
16 | kubernetes-node-alternatives-install-bin-{{ cmd }}:
17 | {%- if grains.os_family not in ('Suse', 'Arch') %}
18 | alternatives.install:
19 | - name: link-k8s-node-{{ cmd }}
20 | - link: /usr/local/bin/{{ cmd }}
21 | - order: 10
22 | - path: {{ d.node['pkg']['path'] }}/bin/{{ cmd }}
23 | - priority: {{ d.linux.altpriority }}
24 | {%- else %}
25 | cmd.run:
26 | - name: update-alternatives --install /usr/local/bin/{{ cmd }} link-k8s-node-{{ cmd }} {{ d.node['pkg']['path'] }}/bin/{{ cmd }} {{ d.linux.altpriority }} # noqa 204
27 | {%- endif %}
28 |
29 | - onlyif:
30 | - test -f {{ d.node['pkg']['path'] }}/bin/{{ cmd }}
31 | - unless:
32 | - update-alternatives --list |grep ^link-k8s-node-{{ cmd }} || false
33 | - update-alternatives --list |grep "^link-k8s-server-{{ cmd }}" || false # avoid server clash
34 | - update-alternatives --list |grep "^link-k8s-client-{{ cmd }}" || false # avoid client clash
35 | - require:
36 | - sls: {{ sls_archive_install if d.client.pkg.use_upstream == 'archive' else sls_binary_install }}
37 | - require_in:
38 | - alternatives: kubernetes-node-alternatives-set-bin-{{ cmd }}
39 |
40 | kubernetes-node-alternatives-set-bin-{{ cmd }}:
41 | alternatives.set:
42 | - unless:
43 | - {{ grains.os_family in ('Suse', 'Arch') }} || false
44 | - update-alternatives --list |grep "^link-k8s-server-{{ cmd }}" || false # avoid server clash
45 | - update-alternatives --list |grep "^link-k8s-client-{{ cmd }}" || false # avoid client clash
46 | - name: link-k8s-node-{{ cmd }}
47 | - path: {{ d.node.pkg.path }}/bin/{{ cmd }}
48 | - onlyif:
49 | - test -f {{ d.node['pkg']['path'] }}/bin/{{ cmd }}
50 |
51 | {%- endfor %}
52 | {%- endif %}
53 |
--------------------------------------------------------------------------------
/kubernetes/node/archive/clean.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- set sls_alternatives_clean = tplroot ~ '.node.alternatives.clean' %}
8 | include:
9 | - {{ sls_alternatives_clean }}
10 |
11 | kubernetes-node-archive-absent:
12 | file.absent:
13 | - names:
14 | - {{ d.dir.tmp }}/kubernetes-node*
15 | - {{ d.node.pkg.path }}
16 | {%- if (d.linux.altpriority|int == 0 and grains.os != 'Windows') or grains.os_family in ('Arch', 'MacOS') %}
17 | {%- for cmd in d.node.pkg.commands|unique %}
18 | - /usr/local/bin/{{ cmd }}
19 | {%- endfor %}
20 | {%- endif %}
21 |
--------------------------------------------------------------------------------
/kubernetes/node/archive/init.sls:
--------------------------------------------------------------------------------
1 | #.-*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .install
6 |
--------------------------------------------------------------------------------
/kubernetes/node/archive/install.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 | {%- from tplroot ~ "/files/macros.jinja" import format_kwargs with context %}
7 |
8 | {%- if d.node.pkg.use_upstream == 'archive' and 'archive' in d.node.pkg %}
9 |
10 | kubernetes-node-archive-install:
11 | {%- if grains.os|lower != 'windows' %}
12 | pkg.installed:
13 | - names: {{ d.pkg.deps|json }}
14 | - require_in:
15 | - file: kubernetes-node-archive-install
16 | {%- endif %}
17 | file.directory:
18 | - name: {{ d.node.pkg.path }}
19 | - makedirs: True
20 | - clean: False # don't
21 | - require_in:
22 | - archive: kubernetes-node-archive-install
23 | {%- if grains.os|lower != 'windows' %}
24 | - mode: 755
25 | - user: {{ d.identity.rootuser }}
26 | - group: {{ d.identity.rootgroup }}
27 | - recurse:
28 | - user
29 | - group
30 | - mode
31 | {%- endif %}
32 | archive.extracted:
33 | {{- format_kwargs(d.node['pkg']['archive']) }}
34 | - retry: {{ d.retry_option|json }}
35 | - enforce_toplevel: false
36 | - trim_output: true
37 | - force: true
38 | - overwrite: {{ d.overwrite }}
39 | - require:
40 | - file: kubernetes-node-archive-install
41 | {%- if grains.os|lower != 'windows' %}
42 | - user: {{ d.identity.rootuser }}
43 | - group: {{ d.identity.rootgroup }}
44 | - recurse:
45 | - user
46 | - group
47 | {%- if d.linux.altpriority|int == 0 or grains.os_family in ('Arch', 'MacOS') %}
48 | {%- for cmd in d.node.pkg.commands|unique %}
49 |
50 | kubernetes-node-archive-install-symlink-{{ cmd }}:
51 | file.symlink:
52 | - name: /usr/local/bin/{{ cmd }}
53 | - target: {{ d.node.pkg.path }}/bin/{{ cmd }}
54 | - force: True
55 | - require:
56 | - archive: kubernetes-node-archive-install
57 |
58 | {%- endfor %}
59 | {%- endif %}
60 | {%- elif grains.os|lower == 'windows' %}
61 |
62 | kubernetes-node-archive-install-bashrc:
63 | file.replace:
64 | - name: C:\cygwin64\home\{{ d.identity.rootuser }}\.bashrc
65 | - pattern: '^export PATH=${PATH}:/cygdrive/c/kubernetes/bin$'
66 | - repl: 'export PATH=${PATH}:/cygdrive/c/kubernetes/bin'
67 | - append_if_not_found: True
68 | cmd.run:
69 | - name: sed -i -e "s/\r//g" C:\cygwin64\home\{{ d.identity.rootuser }}\.bashrc
70 | - onchanges:
71 | - file: kubernetes-node-archive-install-bashrc
72 |
73 | kubernetes-node-archive-install-windows-tidyup:
74 | cmd.run:
75 | - name: mv {{ d.dir.base ~ d.div ~ 'bin' ~ d.div }}*.exe {{ d.dir.base ~ d.div ~ 'bin' ~ d.div }} || True
76 | - onlyif: test -d {{ d.dir.base ~ d.div ~ 'bin' ~ d.div }}
77 | file.absent:
78 | - names:
79 | - {{ d.dir.base ~ d.div ~ 'bin' ~ d.div }}bin
80 | - {{ d.dir.base ~ d.div ~ 'bin' ~ d.div }}owners
81 | - {{ d.dir.base ~ d.div ~ 'bin' ~ d.div }}vendors
82 | - {{ d.dir.base ~ d.div ~ 'bin' ~ d.div }}LICENSE
83 |
84 | {%- endif %}
85 | {%- endif %}
86 |
--------------------------------------------------------------------------------
/kubernetes/node/clean.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .config.clean
6 | - .package.clean
7 | - .archive.clean
8 | - .alternatives.clean
9 |
--------------------------------------------------------------------------------
/kubernetes/node/config/clean.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- set sls_archive_clean = tplroot ~ '.node.archive.clean' %}
8 | {%- set sls_package_clean = tplroot ~ '.node.package.clean' %}
9 |
10 | include:
11 | - {{ sls_archive_clean }}
12 | - {{ sls_package_clean }}
13 |
14 | kubernetes-node-config-clean:
15 | file.absent:
16 | - names:
17 | - {{ d.node.config_file }}
18 | - require:
19 | - sls: {{ sls_archive_clean if d.node.pkg.use_upstream == 'archive' else sls_package_clean }}
20 |
--------------------------------------------------------------------------------
/kubernetes/node/config/environ.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- if 'environ' in d.node and d.node.environ %}
8 | {%- from tplroot ~ "/libtofs.jinja" import files_switch with context %}
9 | {%- set sls_archive_install = tplroot ~ '.node.archive.install' %}
10 | {%- set sls_package_install = tplroot ~ '.node.package.install' %}
11 |
12 | include:
13 | - {{ sls_archive_install if d.node.pkg.use_upstream == 'archive' else sls_package_install }}
14 |
15 | kubernetes-node-config-file-managed-environ_file:
16 | file.managed:
17 | - name: {{ d.node.environ_file }}
18 | - source: {{ files_switch(['environ.sh.jinja'],
19 | lookup='k8s-node-config-file-managed-environ_file'
20 | )
21 | }}
22 | - makedirs: True
23 | - template: jinja
24 | {%- if grains.os != 'Windows' %}
25 | - mode: '0640'
26 | - user: {{ d.identity.rootuser }}
27 | - group: {{ d.identity.rootgroup }}
28 | {%- endif %}
29 | - context:
30 | environ: {{ d.node.environ|json }}
31 | - require:
32 | - sls: {{ sls_archive_install if d.node.pkg.use_upstream == 'archive' else sls_package_install }}
33 |
34 | {%- endif %}
35 |
--------------------------------------------------------------------------------
/kubernetes/node/config/file.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- if 'config' in d.node and d.node.config %}
8 | {%- from tplroot ~ "/libtofs.jinja" import files_switch with context %}
9 | {%- set sls_archive_install = tplroot ~ '.node.archive.install' %}
10 | {%- set sls_package_install = tplroot ~ '.node.package.install' %}
11 |
12 | include:
13 | - {{ sls_archive_install if d.node.pkg.use_upstream == 'archive' else sls_package_install }}
14 |
15 | kubernetes-node-config-file-install-file-managed:
16 | file.managed:
17 | - name: {{ d.node.config_file }}
18 | - source: {{ files_switch(['config.yml.jinja'],
19 | lookup='k8s-node-config-file-install-file-managed'
20 | )
21 | }}
22 | - makedirs: True
23 | {%- if grains.os != 'Windows' %}
24 | - mode: 644
25 | - user: {{ d.identity.rootuser }}
26 | - group: {{ d.identity.rootgroup }}
27 | {%- endif %}
28 | - template: jinja
29 | - context:
30 | config: {{ d.node.config|json }}
31 | - require:
32 | - sls: {{ sls_archive_install if d.node.pkg.use_upstream == 'archive' else sls_package_install }}
33 |
34 | {%- endif %}
35 |
--------------------------------------------------------------------------------
/kubernetes/node/config/init.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .file
6 | - .environ
7 |
--------------------------------------------------------------------------------
/kubernetes/node/init.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .archive.install
6 | - .package.install
7 | - .config
8 | - .alternatives
9 |
--------------------------------------------------------------------------------
/kubernetes/node/package/clean.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- if d.node.pkg.use_upstream in ('package', 'repo') %}
8 | {%- if grains.os_family|lower in ('redhat', 'debian') %}
9 | {%- if d.node.pkg.use_upstream == 'repo' %}
10 | {%- set sls_repo_clean = tplroot ~ '.package.repo.clean' %}
11 | include:
12 | - {{ sls_repo_clean }}
13 | {%- endif %}
14 |
15 | kubernetes-node-package-clean-pkgs:
16 | pkg.removed:
17 | - names: {{ d.node.pkg.commands|unique|json }}
18 | - reload_modules: true
19 | {%- if d.node.pkg.use_upstream == 'repo' %}
20 | - require:
21 | - pkgrepo: kubernetes-package-repo-absent
22 | {%- endif %}
23 |
24 | {%- endif %}
25 | {%- endif %}
26 |
--------------------------------------------------------------------------------
/kubernetes/node/package/init.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .install
6 |
--------------------------------------------------------------------------------
/kubernetes/node/package/install.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- if d.node.pkg.use_upstream in ('package', 'repo') %}
8 | {%- if grains.os_family|lower in ('redhat', 'debian') %}
9 | {%- if d.node.pkg.use_upstream == 'repo' %}
10 | {%- set sls_repo_install = tplroot ~ '.package.repo.install' %}
11 | include:
12 | - {{ sls_repo_install }}
13 | {%- endif %}
14 |
15 | kubernetes-node-package-install-deps:
16 | pkg.installed:
17 | - names: {{ d.pkg.deps|json }}
18 |
19 | kubernetes-node-package-install-pkgs:
20 | pkg.installed:
21 | - names: {{ d.node.pkg.commands|unique|json }}
22 | - runas: {{ d.identity.rootuser }}
23 | - reload_modules: true
24 | {%- if d.node.pkg.use_upstream == 'repo' %}
25 | - require:
26 | - pkgrepo: kubernetes-package-repo-managed
27 | {%- endif %}
28 |
29 | {%- else %}
30 |
31 | kubernetes-node-package-install-other:
32 | test.show_notification:
33 | - text: |
34 | The node package is unavailable for {{ salt['grains.get']('finger', grains.os_family) }}
35 |
36 | {%- endif %}
37 | {%- endif %}
38 |
--------------------------------------------------------------------------------
/kubernetes/operator/clean.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .sdk.clean
6 |
--------------------------------------------------------------------------------
/kubernetes/operator/init.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .sdk
6 |
--------------------------------------------------------------------------------
/kubernetes/operator/sdk/binary/clean.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- if grains.kernel|lower in ('linux', 'darwin') %}
5 |
6 | {%- set tplroot = tpldir.split('/')[0] %}
7 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
8 |
9 | {%- if 'wanted' in d.operator.sdk and d.operator.sdk.wanted %}
10 | {%- for item in d.operator.sdk.wanted|unique %}
11 | {%- if d.operator.sdk.pkg[item]['use_upstream'] == 'binary' %}
12 | {%- set p = d.operator.sdk['pkg'] %}
13 | {%- if item in p and 'binary' in p[item] and 'source' in p[item]['binary'] %}
14 |
15 | kubernetes-operator-sdk-binary-{{ item }}-clean:
16 | file.absent:
17 | - name: {{ p[item]['path'] }}/{{ item }}
18 |
19 | {%- endif %}
20 | {%- endif %}
21 | {%- endfor %}
22 | {%- endif %}
23 | {%- endif %}
24 |
--------------------------------------------------------------------------------
/kubernetes/operator/sdk/binary/init.sls:
--------------------------------------------------------------------------------
1 | #.-*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .install
6 |
--------------------------------------------------------------------------------
/kubernetes/operator/sdk/binary/install.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- if grains.kernel|lower in ('linux', 'darwin', 'windows') %}
8 | {%- if 'wanted' in d.operator.sdk and d.operator.sdk.wanted %}
9 | {%- for item in d.operator.sdk.wanted|unique %}
10 | {%- if d.operator.sdk.pkg[item]['use_upstream'] == 'binary' %}
11 | {%- set p = d.operator.sdk['pkg'] %}
12 | {%- if item in p and 'binary' in p[item] and 'source' in p[item]['binary'] %}
13 |
14 | kubernetes-operator-sdk-binary-{{ item }}-install:
15 | file.managed:
16 | - name: {{ p[item]['path'] }}{{ item }}
17 | - source: {{ p[item]['binary']['source'] }}
18 | - retry: {{ d.retry_option|json }}
19 | - mode: 755
20 | - skip_verify: True
21 | - makedirs: True
22 | - force: True
23 | {%- if grains.os != 'Windows' %}
24 | - user: {{ d.identity.rootuser }}
25 | - group: {{ d.identity.rootgroup }}
26 | - recurse:
27 | - user
28 | - group
29 | - mode
30 | {%- endif %}
31 |
32 | kubernetes-operator-sdk-binary-{{ item }}-verify:
33 | file.managed:
34 | - name: {{ p[item]['path'] }}/{{ item }}.asc
35 | - source: {{ p[item]['binary']['source_hash'] }}
36 | - retry: {{ d.retry_option|json }}
37 | - skip_verify: True
38 | - makedirs: True
39 | - force: True
40 | {%- if grains.os != 'Windows' %}
41 | - mode: 755
42 | - user: {{ d.identity.rootuser }}
43 | - group: {{ d.identity.rootgroup }}
44 | - recurse:
45 | - user
46 | - group
47 | - mode
48 | {%- endif %}
49 | cmd.run:
50 | - names:
51 | - gpg --keyserver {{ d.operator.sdk['rsakeyserver'] }} --recv-key {{ d.operator.sdk['rsakey'] }}
52 | - gpg --verify {{ p[item]['path'] }}{{ item }}.asc
53 | - rm {{ p[item]['path'] }}{{ item }}.asc
54 | - require:
55 | - file: kubernetes-operator-sdk-binary-{{ item }}-install
56 | - file: kubernetes-operator-sdk-binary-{{ item }}-verify
57 |
58 | kubernetes-operator-sdk-binary-{{ item }}-failure:
59 | file.absent:
60 | - names:
61 | - {{ p[item]['path'] }}{{ item }}
62 | - {{ p[item]['path'] }}{{ item }}.asc
63 | - onfail:
64 | - cmd: kubernetes-operator-sdk-binary-{{ item }}-verify
65 |
66 | {%- endif %}
67 | {%- endif %}
68 | {%- endfor %}
69 | {%- endif %}
70 |
71 | {%- endif %}
72 |
--------------------------------------------------------------------------------
/kubernetes/operator/sdk/clean.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .binary.clean
6 |
--------------------------------------------------------------------------------
/kubernetes/operator/sdk/init.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .binary
6 |
--------------------------------------------------------------------------------
/kubernetes/operators/archive/clean.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- if 'wanted' in d.operators and d.operators.wanted %}
8 | {%- for tool in d.operators.wanted|unique %}
9 | {%- if d.operators.pkg[tool]['use_upstream'] == 'archive' %}
10 | {%- if 'pkg' in d.operators and tool in d.operators['pkg'] and d.operators['pkg'][tool] %}
11 |
12 | kubernetes-operators-archive-{{ tool }}-clean:
13 | file.absent:
14 | - names:
15 | - {{ d.operators['pkg'][tool]['path'] }}
16 |
17 | {% endif %}
18 | {% endif %}
19 | {%- endfor %}
20 | {%- endif %}
21 |
--------------------------------------------------------------------------------
/kubernetes/operators/archive/init.sls:
--------------------------------------------------------------------------------
1 | #.-*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .install
6 |
--------------------------------------------------------------------------------
/kubernetes/operators/archive/install.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- from tplroot ~ "/files/macros.jinja" import format_kwargs with context %}
8 |
9 | {%- if grains.os != 'Windows' %}
10 | kubernetes-operators-archive-deps-install:
11 | pkg.installed:
12 | - names: {{ d.pkg.deps|json }}
13 | {%- endif %}
14 |
15 | {%- if 'wanted' in d.operators and d.operators.wanted %}
16 | {%- for tool in d.operators.wanted|unique %}
17 | {%- if 'pkg' in d.operators and tool in d.operators['pkg'] and d.operators.pkg[tool] %}
18 | {%- if d.operators.pkg[tool]['use_upstream'] == 'archive' and 'archive' in d.operators.pkg[tool] %}
19 |
20 | kubernetes-operators-archive-{{ tool }}-install:
21 | file.directory:
22 | - name: {{ d.operators.pkg[tool]['path'] }}
23 | - clean: {{ d.clean }}
24 | - makedirs: True
25 | - require_in:
26 | - archive: kubernetes-operators-archive-{{ tool }}-install
27 | {%- if grains.os != 'Windows' %}
28 | - require:
29 | - pkg: kubernetes-operators-archive-deps-install
30 | - mode: 755
31 | - user: {{ d.identity.rootuser }}
32 | - group: {{ d.identity.rootgroup }}
33 | - recurse:
34 | - user
35 | - group
36 | - mode
37 | {%- endif %}
38 | archive.extracted:
39 | {{- format_kwargs(d.operators.pkg[tool]['archive']) }}
40 | - retry: {{ d.retry_option }}
41 | - enforce_toplevel: false
42 | - trim_output: true
43 | {%- if grains.os != 'Windows' %}
44 | - user: {{ d.identity.rootuser }}
45 | - group: {{ d.identity.rootgroup }}
46 | - recurse:
47 | - user
48 | - group
49 | {%- endif %}
50 |
51 | {% endif %}
52 | {% endif %}
53 | {%- endfor %}
54 | {%- endif %}
55 |
--------------------------------------------------------------------------------
/kubernetes/operators/clean.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .archive.clean
6 |
--------------------------------------------------------------------------------
/kubernetes/operators/init.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .archive
6 |
--------------------------------------------------------------------------------
/kubernetes/osarchmap.yaml:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=yaml
3 | #
4 | # Setup variables using grains['osarch'] based logic.
5 | # You just need to add the key:values for an `osarch` that differ
6 | # from `defaults.yaml` + `os_family.yaml`.
7 | # Only add an `osarch` which is/will be supported by the formula
8 | #
9 | # If you do not need to provide defaults via the `osarch` grain,
10 | # you will need to provide at least an empty dict in this file, e.g.
11 | # osarch: {}
12 | ---
13 | arm64:
14 | arch: arm64
15 | client:
16 | pkg:
17 | use_upstream: archive
18 | archive:
19 | source_hash: '0b2265f27baad42425f6d815182261542efba2e5defccdb92668a50ff0f49c831f3af4ea6c38f351004ab1eafc270871e443e673188f37463ee3012da20cfc27' # noqa 204
20 | node:
21 | pkg:
22 | use_upstream: archive
23 | archive:
24 | source_hash: 'eb6a5cb5270a662a79302472a347a5486b3e0689c0c8ea0ceb62e83f72c043dc3b15ee3d5ec40790a1754748950208d8b5818b3f1d64e44a881720a78f50cc7e' # noqa 204
25 | server:
26 | pkg:
27 | use_upstream: archive
28 | archive:
29 | source_hash: 'bf7d8978b72409f02c1b7ad5f44a908f31287ee715966e47726c3f9f85c349a14f457cd84160cfe78d4e39233a119afd152528ed79db5eef6558a25098825438' # noqa 204
30 |
31 | sigs:
32 | pkg:
33 | kubebuiler:
34 | use_upstream: archive
35 | archive:
36 | source_hash: '017ec01bb20535bd22f1e75218d4effffea5457a2378886981ff4f986b05eb31' # noqa 204
37 | kind:
38 | binary:
39 | source_hash: '4f019c578600c087908ac59dd0c4ce1791574f153a70608adb372d5abc58cd47' # noqa 204
40 |
41 | devtools:
42 | pkg:
43 | kubectx:
44 | archive:
45 | source_hash: '5fab3c0624a83cf8fff5c34d90f854af6fa8b501ed63306aaf5355303ae884ed' # noqa 204
46 | kubens:
47 | archive:
48 | source_hash: '7c2d0d4d46338bf400ebba1b23947d35b25725b9b4e3e1932bb88b3ec3f96a5a' # noqa 204
49 | cue:
50 | archive:
51 | source_hash: 'd101a36607981a7652b7961955a84102c912ac35ca9d91de63a0201f2416ecfa' # noqa 204
52 | audit2rbac:
53 | archive:
54 | source_hash: '819361a9b61ce02dc86bbe789b1da54dd887c2841f1a92ed0abb790738efc7f2' # noqa 204
55 | octant:
56 | archive:
57 | source_hash: 'd77232fff9dcb1fc4f742ad635f5ec546d75fc09f79c75962a2f97279a513050' # noqa 204
58 | kudo:
59 | archive:
60 | source_hash: 'faf846f66b93b82bb1c0c6974c30b8f2d1bfcd39168814e148745e6066784027' # noqa 204
61 | operator:
62 | sdk:
63 | pkg:
64 | ansible-operator:
65 | binary:
66 | source_hash: 'e1e10a404a80c9643c696a7966769a60439b4df5c8736dbf7b1b871ae5a669b6' # noqa 204
67 | helm-operator:
68 | binary:
69 | source_hash: '07bad360be1371ba1d4f0f6334ec97f108c70cd7cf08183ffb24a7e00f8422d2' # noqa 204
70 | operator-sdk:
71 | binary:
72 | source_hash: '55e333020911f203348bd4efa3caea83e5a7bf1814074a1f486781355fff4557' # noqa 204
73 | operators:
74 | pkg:
75 | grafana-operator:
76 | archive:
77 | source_hash: 'e6cd1ba9e15ef3649e77f40246f7b16a2aabd01cf5ec3c47e8fd879be384a0d1' # noqa 204
78 |
79 | ppc64le:
80 | arch: ppc64le
81 | client:
82 | pkg:
83 | use_upstream: archive
84 | archive:
85 | source_hash: 'a689eaef1c0788eb734fd5e70899f4cd0bc4ad6dd9f56827e7d55cab4acb2b1b0035226e69e1230fe74ac45accbbafbcc616c00fabe8dc55b9d8f94519cde253' # noqa 204
86 | node:
87 | pkg:
88 | use_upstream: archive
89 | archive:
90 | source_hash: '45038ed6ee110d04ea7fb18e8f3c5f33aff2cc291a169d7a2f5f37ae1780b534ff5cd2895b7c2a9fb675a8490c9da7518e09f4ca9e2af4d57238557e1021d255' # noqa 204
91 | server:
92 | pkg:
93 | use_upstream: archive
94 | archive:
95 | source_hash: '9546df4488665af35a7289e77f8b194f12e5939199411fb8f4b2f15db5e669eef9dfba950315205d39f4d89c135fbccd37e8ad9c554a482bb09977234d7d7185' # noqa 204
96 |
97 | sigs:
98 | pkg:
99 | kubebuiler:
100 | use_upstream: archive
101 | archive:
102 | source_hash: '2f4f2c5477aa6417f9785e8aa9655ed69f7eb7444d5395c020896c3d764f070d' # noqa 204
103 | kind:
104 | binary:
105 | source_hash: '3f7e6de1b60c9b788975cf59c9cb2ee253f257278eb14ea0419c9b97fa2988ad' # noqa 204
106 |
107 | devtools:
108 | pkg:
109 | audit2rbac:
110 | archive:
111 | source_hash: 'f992061aad5ebacbf5694f63cefa4d4e0f12515322196bd8eaf3c040852491c6' # noqa 204
112 | kubectx:
113 | archive:
114 | source_hash: '046066f2492fc9c45e2444c6c70220ecc143ec024cbed2ea205630affded9fce' # noqa 204
115 | kubens:
116 | archive:
117 | source_hash: 'b63bbf5d13a76aa8b9b5135afbe6a0a5a4f59053024ca4cb2c7ec8e32fbd2d87' # noqa 204
118 | operator:
119 | sdk:
120 | pkg:
121 | ansible-operator:
122 | binary:
123 | source_hash: '3c9f38a4933908e74ad8da95dad218aa56aa788e8ee22fad801adca93699872a' # noqa 204
124 | helm-operator:
125 | binary:
126 | source_hash: '4979ce56909903f89a79d50858d6c85dd4ffe3527edbfcaa0305c550d5aaa63b' # noqa 204
127 | operator-sdk:
128 | binary:
129 | source_hash: '770ef0792bdb622f5120c1718933ff334f2f8701d1bd172d5c8368644a5b99ec' # noqa 204
130 |
131 | ppc64:
132 | arch: ppc64
133 | devtools:
134 | pkg:
135 | audit2rbac:
136 | archive:
137 | source_hash: '4c297670d26d7eefddb20d60ba1e4c389245c81ddb9c80c8efb330b06314db28'
138 |
139 | amd64:
140 | arch: amd64
141 |
142 | x86_64:
143 | arch: amd64
144 |
145 | 386:
146 | arch: 386
147 | devtools:
148 | pkg:
149 | audit2rbac:
150 | archive:
151 | source_hash: '11ec8ed082fe8555c0537e437aa0448e00a135322fff05410594f691d3632398'
152 | client:
153 | pkg:
154 | use_upstream: archive
155 | archive:
156 | source_hash: '4c0a27dba1077aaee943e0eb7a787239dd697e1d968e78d1933c1e60b02d5d233d58541d5beec59807a4ffe3351d5152359e11da120bf64cacb3ee29fbc242e6' # noqa 204
157 | operators:
158 | pkg:
159 | grafana-operator:
160 | archive:
161 | source_hash: 'fc6439926dfc7eeecba770f7f156676f02c1d7ce68bebdc4fd5f1e88f1f38220' # noqa 204
162 |
163 | armv6l:
164 | arch: armv6l
165 | client:
166 | pkg:
167 | use_upstream: archive
168 | archive:
169 | source_hash: 'd3627b763606557a6c9a5766c34198ec00b3a3cd72a55bc2cb47731060d31c4af93543fb53f53791062bb5ace2f15cbaa8592ac29009641e41bd656b0983a079' # noqa 204
170 |
171 | armhf:
172 | arch: armhf
173 | devtools:
174 | pkg:
175 | kubectx:
176 | archive:
177 | source_hash: '7132ed27daf0c93b259452032703721bbc881bc1655a4eb5f6df3d489f1ef1bb' # noqa 204
178 | kubens:
179 | archive:
180 | source_hash: 'f7b888ba40ec139e1321616d62953d850c6de8ece3ac6e5169a8faba4eadb1c8' # noqa 204
181 |
182 | armv7l:
183 | arch: armv7l
184 | devtools:
185 | pkg:
186 | kubectx:
187 | archive:
188 | source_hash: 'ec1eaa54b3798282e2dac3a7b81ed11a657d55365bc8c8ad81933517124f87a6' # noqa 204
189 | kubens:
190 | archive:
191 | source_hash: 'b430dbcb89f610d09c46015c29467b133d1c01213b73647ec577d86634e914ff' # noqa 204
192 | client:
193 | pkg:
194 | use_upstream: archive
195 | archive:
196 | source_hash: 'd3627b763606557a6c9a5766c34198ec00b3a3cd72a55bc2cb47731060d31c4af93543fb53f53791062bb5ace2f15cbaa8592ac29009641e41bd656b0983a079' # noqa 204
197 |
198 | s390x:
199 | arch: s390x
200 | client:
201 | pkg:
202 | use_upstream: archive
203 | archive:
204 | source_hash: 'a76300dbd915b232826d022e1fd5b8a336e7de2089d897aed594381ad571396619609498687eba75f2dcb7fe2fb2bfe50fe6a199eda53af8513d9b3b2967b7ec' # noqa 204
205 | node:
206 | pkg:
207 | use_upstream: archive
208 | archive:
209 | source_hash: '45038ed6ee110d04ea7fb18e8f3c5f33aff2cc291a169d7a2f5f37ae1780b534ff5cd2895b7c2a9fb675a8490c9da7518e09f4ca9e2af4d57238557e1021d255' # noqa 204
210 | server:
211 | pkg:
212 | use_upstream: archive
213 | archive:
214 | source_hash: 'e1eb0868e613e27ea7f71df5875c5d0b107a7fc38525151dffd22826c7a47111ece7d3948badb28b1a1c9d8cabca70af54cdc1501e5aadf5c842bf09bd26f1c2' # noqa 204
215 | operator:
216 | sdk:
217 | pkg:
218 | ansible-operator:
219 | binary:
220 | source_hash: 'c34354410f982098c856700b7216929e223b91c4d284c29a5beccca060331aed' # noqa 204
221 | helm-operator:
222 | binary:
223 | source_hash: 'a5523c94a5466fb2ac47aae37d996c9b85d9def57df29633f590d8e20dbae868' # noqa 204
224 | operator-sdk:
225 | binary:
226 | source_hash: '055918df06719f87eafdf53547a4f24390f99c070aee1d197b906e1563005442' # noqa 204
227 |
--------------------------------------------------------------------------------
/kubernetes/osfamilymap.yaml:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=yaml
3 | #
4 | # Setup variables using grains['os_family'] based logic.
5 | # You just need to add the key:values for an `os_family` that differ
6 | # from `defaults.yaml`.
7 | # Only add an `os_family` which is/will be supported by the formula
8 | #
9 | # If you do not need to provide defaults via the `os_family` grain,
10 | # you will need to provide at least an empty dict in this file, e.g.
11 | # osfamilymap: {}
12 | ---
13 | {%- if grains.os == 'MacOS' %}
14 | {%- set rootuser = salt['cmd.run']("stat -f '%Su' /dev/console") %}
15 | {%- set rootgroup = salt['cmd.run']("stat -f '%Sg' /dev/console") %}
16 | {%- elif grains.os == 'Windows' %}
17 | {%- set rootuser = salt['cmd.run']("id -un") %}
18 | {%- endif %}
19 |
20 | Debian:
21 | pkg:
22 | repo:
23 | name: deb https://apt.kubernetes.io/ kubernetes-xenial main
24 | file: /etc/apt/sources.list.d/kubernetes.list
25 | key_url: https://packages.cloud.google.com/apt/doc/apt-key.gpg
26 | devtools:
27 | pkg:
28 | minikube:
29 | use_upstream: binary
30 |
31 | RedHat:
32 | pkg:
33 | deps:
34 | - tar
35 | - gzip
36 | deps_url:
37 | - https://rpm.rancher.io/k3s-selinux-0.1.1-rc1.el7.noarch.rpm
38 | repo:
39 | baseurl: 'https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64'
40 | gpgkey: 'https://packages.cloud.google.com/yum/doc/yum-key.gpg gpgkey2=https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg'
41 | repo_gpgcheck: 1
42 |
43 | Suse:
44 | pkg:
45 | deps:
46 | - tar
47 | - gzip
48 |
49 | Gentoo: {}
50 |
51 | Arch:
52 | pkg:
53 | deps:
54 | - tar
55 | - gzip
56 | - which
57 | linux:
58 | altpriority: 0
59 |
60 | Alpine: {}
61 |
62 | FreeBSD:
63 | identity:
64 | rootgroup: wheel
65 | client:
66 | pkg:
67 | use_upstream: false
68 | devtools:
69 | pkg:
70 | minikube:
71 | use_upstream: false
72 |
73 | OpenBSD:
74 | identity:
75 | rootgroup: wheel
76 | client:
77 | pkg:
78 | use_upstream: false
79 | devtools:
80 | pkg:
81 | minikube:
82 | use_upstream: archive
83 |
84 | Windows:
85 | div: '\\'
86 | identity:
87 | rootuser: {{ rootuser | d('') }}
88 | dir:
89 | base: C:\\kubernetes
90 | source: C:\\kubernetes\src\libs
91 | operators: C:\\kubernetes\src
92 | tmp: C:\\temp\kubernetes
93 | client:
94 | check: systeminfo
95 | aliases_file: C:\kubernetes\etc\aliases.sh
96 | pkg:
97 | name: kubernetes-cli # choco
98 | suffix: ''
99 | use_upstream: package
100 | binary:
101 | options: '--strip-components=2' # windows
102 | source_hash: '88e30aee1103ab6b4f3c2bd5570b4f739cbc01b4755bfaee915dcb717ae4d8b0b99457e2bb44cc60f47b77822ce6119fbe77bdfbaaf4afa4220b78b40b1c9b2c' # noqa 204
103 | server: {} # none
104 | node:
105 | config_file: C:\kubernetes\etc\node.ini
106 | pkg:
107 | use_upstream: archive
108 | archive:
109 | options: '--strip-components=3' # windows
110 | source_hash: 'a38016acc743eb87d4803d2d06c24fc3315a4db6eacbd3f2060f28355ca96f1b3294b30483b74ecea18fe220a9d1319509f26fe02615fbaa7f1ecd11f76b1f6b' # noqa 204
111 |
112 | sigs:
113 | pkg:
114 | kind:
115 | binary:
116 | source_hash: 'd309d8056cec8bcabb24e185200ef8f9702e0c01a9ec8a7f7185fe956783ed97'
117 | krew:
118 | use_upstream: binary
119 | suffix: exe
120 | uri_b: 'https://github.com/kubernetes-sigs/krew/releases/download'
121 | binary: {}
122 | kubebuilder:
123 | use_upstream: false # no windows binary
124 |
125 | devtools:
126 | pkg:
127 | minikube:
128 | suffix: exe
129 | config_file: C:\kubernetes\etc\minikube.ini
130 | environ_file: C:\kubernetes\etc\minkube.sh
131 | binary: {}
132 | devspace:
133 | name: devspace
134 | suffix: exe
135 | octant:
136 | suffix: zip
137 | archive:
138 | source_hash: '39c484e6d5e957cb1403afbc99cc0b11d77d101c57e7c9fa686d5db72bd3064a' # noqa 204
139 | options: '' # zipfile
140 | k3s:
141 | use_upstream: false # no windows binary
142 | kubectx:
143 | suffix: zip
144 | archive:
145 | source_hash: '31a30912ace13fe0a458a253bc76bd106c48f3b0967ac2676cfd8b7fae71e314' # noqa 204
146 | options: ''
147 | kubens:
148 | suffix: zip
149 | archive:
150 | source_hash: 'eab9ace6e25303b522e7006a1c9e44747b9e9c005e15b1fcf8a9678569ca1c95' # noqa 204
151 | options: ''
152 | kudo:
153 | use_upstream: false # windows not available
154 | istio:
155 | suffix: zip
156 | arch: '' # noarch
157 | archive:
158 | options: '' # zipfile
159 | cue:
160 | suffix: zip
161 | archive:
162 | source_hash: '13a2db61e78473db0fab0530e8ebf70aa37ed6fb88ee14df240880ec7e70c0f1' # noqa 204
163 | options: ''
164 | audit2rbac:
165 | archive:
166 | source_hash: '57e1b6f108141da818eb29ad5755d386f56be067737302fabfa092e335c6ce57' # noqa 204
167 | stern:
168 | suffix: exe
169 | binary:
170 | source_hash: '75708b9acf6ef0eeffbe1f189402adc0405f1402e6b764f1f5152ca288e3109e' # noqa 204
171 | dive:
172 | suffix: zip
173 | archive:
174 | source_hash: 'e88cf463b48d9edc22f71b63d43f076826f32f6777ac9a8d288dd3dd8f0599e3' # noqa 204
175 | options: ''
176 | linkerd2:
177 | name: linkerd2-cli-edge
178 | suffix: exe
179 | skaffold:
180 | suffix: exe
181 |
182 | MacOS:
183 | dir:
184 | default: /etc/defaults
185 | identity:
186 | rootuser: {{ rootuser | d('') }}
187 | rootgroup: {{ rootgroup | d('') }}
188 | server: {}
189 | node: {}
190 | client:
191 | aliases_file: /etc/defaults/kubernetes-aliases.sh
192 | pkg:
193 | name: kubernetes-cli # homebrew
194 | use_upstream: archive
195 | archive:
196 | source_hash: '41dcfff40498335c92d872eb6aa6215d9d84908f79bdf61777d52243a446fffb114313fb586ec6a58908684eaf86fae6b2fbaa70a2a3f06f78470a20ca4d9727' # noqa 204
197 |
198 | sigs:
199 | pkg:
200 | kubebuilder:
201 | binary:
202 | source_hash: '2a6c5e0e276b65cfbe173fca07b318ecff1752bf947002641b808c4a40187f2c' # noqa 204
203 | kind:
204 | name: kind # homebrew
205 | binary:
206 | source_hash: '432bef555a70e9360b44661c759658265b9eaaf7f75f1beec4c4d1e6bbf97ce3' # noqa 204
207 | krew:
208 | commands:
209 | - krew-darwin_amd64
210 |
211 | devtools:
212 | pkg:
213 | minikube:
214 | check: sysctl -a | grep machdep.cpu.features
215 | name: minikube # homebrew
216 | use_upstream: binary
217 | binary: {}
218 | devspace:
219 | use_upstream: binary
220 | kudo:
221 | name: kudo-cli # homebrew
222 | tapname: kudobuilder/tap
223 | binary:
224 | source_hash: '95a62092b75b43c147f5b9942f8b0b06ecf3cf34ccad4f301295c618c8ae3514' # noqa 204
225 | octant:
226 | suffix: zip
227 | archive:
228 | source_hash: '26004633ee0abca5e810e0fe3dacc950dccdd5b963a6d6f35c2f3addb21df5df' # noqa 204
229 | options: '' # zipfile
230 | linkerd2:
231 | binary:
232 | source_hash: '1adc9c53fe968383020b6c4047d42452754e05bc90d1a65f2261d729c6fab4df' # noqa 204
233 | k3s:
234 | use_upstream: false # no macos binary
235 | kubectx:
236 | archive:
237 | source_hash: '7adeaf057809ef756b6f290c2e0557e86c1d04718239166a9ef0298db6fe5b27' # noqa 204
238 | kubens:
239 | archive:
240 | source_hash: 'ef43ab1217e09ac1b929d4b9dd2c22cbb10540ef277a3a9b484c020820c988b1' # noqa 204
241 | cue:
242 | archive:
243 | source_hash: '24717a72b067a4d8f4243b51832f4a627eaa7e32abc4b9117b0af9aa63ae0332' # noqa 204
244 | stern:
245 | archive:
246 | source_hash: '7aea3b6691d47b3fb844dfc402905790665747c1e6c02c5cabdd41994533d7e9' # noqa 204
247 | dive:
248 | archive:
249 | source_hash: 'b4cad081146defcb90b418215cdfdf835372abd4adf1b0f33aaf1ea5d9bb3244' # noqa 204
250 | audit2rbac:
251 | archive:
252 | source_hash: 'e89d9e7e6e68d7fdf135ab0912f57afda0fea07931ac443a367d35671f83d1b1' # noqa 204
253 | skaffold:
254 | binary:
255 | source_hash: '1e9ad5ed0ba3b277c582dbdb7e13c3307ff1dc21887bf18d4c5aece486e0518c' # noqa 204
256 |
257 | operator:
258 | sdk:
259 | pkg:
260 | ansible-operator:
261 | binary:
262 | source_hash: 'd1d2414318a3417112b788ddf04b99ad00c133721e313a74c678c47df3bb7bac' # noqa 204
263 | helm-operator:
264 | binary:
265 | source_hash: '14ccf72c1f4781096174d62ff385bd9de9617ef4fc0d612f21f0ae00439b2fd9' # noqa 204
266 | operator-sdk:
267 | binary:
268 | source_hash: '37c246ea83bfc339d0e323bb4b02712cd6e1ba71f87be658d42ecfb12f03fd46' # noqa 204
269 |
270 | operators:
271 | pkg:
272 | grafana-operator:
273 | archive:
274 | source_hash: '65a0ae518331e0830fcb73ff83ab09fae8b101037610587a0038b8c0f6fb64db' # noqa 204
275 |
--------------------------------------------------------------------------------
/kubernetes/osfingermap.yaml:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=yaml
3 | #
4 | # Setup variables using grains['osfinger'] based logic.
5 | # You just need to add the key:values for an `osfinger` that differ
6 | # from `defaults.yaml` + `osarch.yaml` + `os_family.yaml` + `osmap.yaml`.
7 | # Only add an `osfinger` which is/will be supported by the formula.
8 | #
9 | # If you do not need to provide defaults via the `os_finger` grain,
10 | # you will need to provide at least an empty dict in this file, e.g.
11 | # osfingermap: {}
12 | ---
13 | CentOS Linux-8:
14 | pkg:
15 | deps:
16 | - selinux-policy
17 | CentOS Linux-7:
18 | pkg:
19 | deps:
20 | - selinux-policy-minimum
21 | CentOS-6:
22 | pkg:
23 | deps:
24 | - selinux-policy-minimum
25 |
--------------------------------------------------------------------------------
/kubernetes/osmap.yaml:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=yaml
3 | #
4 | # Setup variables using grains['os'] based logic.
5 | # You just need to add the key:values for an `os` that differ
6 | # from `defaults.yaml` + `osarch.yaml` + `os_family.yaml`.
7 | # Only add an `os` which is/will be supported by the formula.
8 | #
9 | # If you do not need to provide defaults via the `os` grain,
10 | # you will need to provide at least an empty dict in this file, e.g.
11 | # osmap: {}
12 | ---
13 | Fedora:
14 | pkg:
15 | deps:
16 | - selinux-policy-minimum
17 |
18 | RedHat:
19 | pkg:
20 | deps:
21 | - tar
22 | - gzip
23 | - container-selinux
24 |
25 | CentOS:
26 | pkg:
27 | deps:
28 | - tar
29 | - gzip
30 | - container-selinux
31 |
32 | Rocky:
33 | pkg:
34 | deps:
35 | - tar
36 | - gzip
37 | - container-selinux
38 |
--------------------------------------------------------------------------------
/kubernetes/package/repo/clean.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | kubernetes-package-repo-absent:
8 | pkgrepo.absent:
9 | - name: {{ d.pkg.repo.name }}
10 | - onlyif:
11 | - {{ d.pkg.repo }}
12 |
--------------------------------------------------------------------------------
/kubernetes/package/repo/init.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .install
6 |
--------------------------------------------------------------------------------
/kubernetes/package/repo/install.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 | {%- from tplroot ~ "/files/macros.jinja" import format_kwargs with context %}
7 |
8 | kubernetes-package-repo-managed:
9 | pkgrepo.managed:
10 | {{- format_kwargs(d.pkg.repo) }}
11 | - onlyif:
12 | - {{ d.pkg.repo }}
13 |
--------------------------------------------------------------------------------
/kubernetes/server/alternatives/clean.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- if d.linux.altpriority|int > 0 and grains.kernel == 'Linux' and grains.os_family not in ('Arch',) %}
8 | {%- for cmd in d.server.pkg.commands|unique %}
9 |
10 | kubernetes-server-alternatives-clean-{{ cmd }}:
11 | alternatives.remove:
12 | - name: link-k8s-server-{{ cmd }}
13 | - path: {{ d.server.pkg.path }}/bin/{{ cmd }}
14 | - onlyif:
15 | - update-alternatives --list |grep ^link-k8s-server-{{ cmd }}
16 |
17 | {%- endfor %}
18 | {%- endif %}
19 |
--------------------------------------------------------------------------------
/kubernetes/server/alternatives/init.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .install
6 |
--------------------------------------------------------------------------------
/kubernetes/server/alternatives/install.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- if d.linux.altpriority|int > 0 and grains.kernel == 'Linux' and grains.os_family not in ('Arch',) %}
8 | {%- set sls_archive_install = tplroot ~ '.server.archive.install' %}
9 | {%- set sls_package_install = tplroot ~ '.server.package.install' %}
10 |
11 | include:
12 | - {{ sls_archive_install }}
13 | - {{ sls_package_install }}
14 |
15 | {%- for cmd in d.server.pkg.commands|unique %}
16 | kubernetes-server-alternatives-install-bin-{{ cmd }}:
17 | {%- if grains.os_family not in ('Suse', 'Arch') %}
18 | alternatives.install:
19 | - name: link-k8s-server-{{ cmd }}
20 | - link: /usr/local/bin/{{ cmd }}
21 | - order: 10
22 | - path: {{ d.server['pkg']['path'] }}/bin/{{ cmd }}
23 | - priority: {{ d.linux.altpriority }}
24 | {%- else %}
25 | cmd.run:
26 | - name: update-alternatives --install /usr/local/bin/{{ cmd }} link-k8s-server-{{ cmd }} {{ d.server['pkg']['path'] }}/bin/{{ cmd }} {{ d.linux.altpriority }} # noqa 204
27 | {%- endif %}
28 |
29 | - onlyif:
30 | - test -f {{ d.server['pkg']['path'] }}/bin/{{ cmd }}
31 | - unless:
32 | - update-alternatives --list |grep ^link-k8s-server-{{ cmd }} || false
33 | - update-alternatives --list |grep "^link-k8s-client-{{ cmd }}" || false # avoid client clash
34 | - update-alternatives --list |grep "^link-k8s-node-{{ cmd }}" || false # avoid node clash
35 | - require:
36 | - sls: {{ sls_archive_install if d.client.pkg.use_upstream == 'archive' else sls_binary_install }}
37 | - require_in:
38 | - alternatives: kubernetes-server-alternatives-set-bin-{{ cmd }}
39 |
40 | kubernetes-server-alternatives-set-bin-{{ cmd }}:
41 | alternatives.set:
42 | - unless:
43 | - {{ grains.os_family in ('Suse', 'Arch') }} || false
44 | - update-alternatives --list |grep "^link-k8s-client-{{ cmd }}" || false # avoid client clash
45 | - update-alternatives --list |grep "^link-k8s-node-{{ cmd }}" || false # avoid node clash
46 | - name: link-k8s-server-{{ cmd }}
47 | - path: {{ d.server.pkg.path }}/bin/{{ cmd }}
48 | - onlyif:
49 | - test -f {{ d.server['pkg']['path'] }}/bin/{{ cmd }}
50 |
51 | {%- endfor %}
52 | {%- endif %}
53 |
--------------------------------------------------------------------------------
/kubernetes/server/archive/clean.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- set sls_alternatives_clean = tplroot ~ '.server.alternatives.clean' %}
8 | include:
9 | - {{ sls_alternatives_clean }}
10 |
11 | kubernetes-server-archive-absent:
12 | file.absent:
13 | - names:
14 | - {{ d.dir.tmp }}/kubernetes-server
15 | - {{ d.server.pkg.path }}
16 | {%- if (d.linux.altpriority|int == 0 and grains.os != 'Windows') or grains.os_family in ('Arch', 'MacOS') %}
17 | {%- for cmd in d.server.pkg.commands|unique %}
18 | - /usr/local/bin/{{ cmd }}
19 | {%- endfor %}
20 | {%- endif %}
21 |
--------------------------------------------------------------------------------
/kubernetes/server/archive/init.sls:
--------------------------------------------------------------------------------
1 | #.-*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .install
6 |
--------------------------------------------------------------------------------
/kubernetes/server/archive/install.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- if grains.kernel|lower in ('linux', 'darwin') %}
8 | {%- from tplroot ~ "/files/macros.jinja" import format_kwargs with context %}
9 | {%- if d.server.pkg['use_upstream'] == 'archive' and 'archive' in d.server.pkg %}
10 |
11 | kubernetes-server-archive-install:
12 | pkg.installed:
13 | - names: {{ d.pkg.deps|json }}
14 | - require_in:
15 | - file: kubernetes-server-archive-install
16 | file.directory:
17 | - name: {{ d.server.pkg.path }}
18 | - makedirs: True
19 | - clean: {{ d.clean }}
20 | - require_in:
21 | - archive: kubernetes-server-archive-install
22 | - mode: 755
23 | - user: {{ d.identity.rootuser }}
24 | - group: {{ d.identity.rootgroup }}
25 | - recurse:
26 | - user
27 | - group
28 | - mode
29 | archive.extracted:
30 | {{- format_kwargs(d.server['pkg']['archive']) }}
31 | - retry: {{ d.retry_option|json }}
32 | - enforce_toplevel: false
33 | - trim_output: true
34 | - require:
35 | - file: kubernetes-server-archive-install
36 | - user: {{ d.identity.rootuser }}
37 | - group: {{ d.identity.rootgroup }}
38 | - recurse:
39 | - user
40 | - group
41 | {%- if d.linux.altpriority|int == 0 or grains.os_family in ('Arch', 'MacOS') %}
42 | {%- for cmd in d.server.pkg.commands|unique %}
43 |
44 | kubernetes-server-archive-install-symlink-{{ cmd }}:
45 | file.symlink:
46 | - name: /usr/local/bin/{{ cmd }}
47 | - target: {{ d.server.pkg.path }}/bin/{{ cmd }}
48 | - force: True
49 | - onlyif: test -x {{ d.server.pkg.path }}/bin/{{ cmd }}
50 | - require:
51 | - archive: kubernetes-server-archive-install
52 |
53 | {%- endfor %}
54 | {%- endif %}
55 | {%- endif %}
56 | {%- else %}
57 |
58 | kubernetes-server-archive-install-other:
59 | test.show_notification:
60 | - text: |
61 | The server archive is unavailable for {{ salt['grains.get']('finger', grains.os_family) }}
62 |
63 | {%- endif %}
64 |
--------------------------------------------------------------------------------
/kubernetes/server/clean.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .config.clean
6 | - .package.clean
7 | - .archive.clean
8 | - .alternatives.clean
9 |
--------------------------------------------------------------------------------
/kubernetes/server/config/clean.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 | {%- set sls_archive_clean = tplroot ~ '.server.archive.clean' %}
7 | {%- set sls_package_clean = tplroot ~ '.server.package.clean' %}
8 |
9 | include:
10 | - {{ sls_archive_clean if d.server.pkg.use_upstream == 'archive' else sls_package_clean }}
11 |
12 | kubernetes-server-config-clean:
13 | file.absent:
14 | - names:
15 | - {{ d.server.config_file }}
16 | - {{ d.server.environ_file }}
17 | - require:
18 | - sls: {{ sls_archive_clean if d.server.pkg.use_upstream == 'archive' else sls_package_clean }}
19 |
--------------------------------------------------------------------------------
/kubernetes/server/config/environ.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- if 'environ' in d.server and d.server.environ %}
8 | {%- from tplroot ~ "/libtofs.jinja" import files_switch with context %}
9 | {%- set sls_archive_install = tplroot ~ '.server.archive.install' %}
10 | {%- set sls_package_install = tplroot ~ '.server.package.install' %}
11 |
12 | include:
13 | - {{ sls_archive_install if d.server.pkg.use_upstream == 'archive' else sls_package_install }}
14 |
15 | kubernetes-server-config-file-managed-environ_file:
16 | file.managed:
17 | - name: {{ d.server.environ_file }}
18 | - source: {{ files_switch(['environ.sh.jinja'],
19 | lookup='k8s-server-config-file-managed-environ_file'
20 | )
21 | }}
22 | - makedirs: True
23 | {%- if grains.os != 'Windows' %}
24 | - mode: '0640'
25 | - user: {{ d.identity.rootuser }}
26 | - group: {{ d.identity.rootgroup }}
27 | {%- endif %}
28 | - template: jinja
29 | - context:
30 | environ: {{ d.server.environ|json }}
31 | - require:
32 | - sls: {{ sls_archive_install if d.server.pkg.use_upstream == 'archive' else sls_package_install }}
33 |
34 | {%- endif %}
35 |
--------------------------------------------------------------------------------
/kubernetes/server/config/file.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- if 'config' in d.server and d.server.config %}
8 | {%- from tplroot ~ "/libtofs.jinja" import files_switch with context %}
9 | {%- set sls_archive_install = tplroot ~ '.server.archive.install' %}
10 | {%- set sls_package_install = tplroot ~ '.server.package.install' %}
11 |
12 | include:
13 | - {{ sls_archive_install if d.server.pkg.use_upstream == 'archive' else sls_package_install }}
14 |
15 | kubernetes-server-config-file-install-file-managed:
16 | file.managed:
17 | - name: {{ d.server.config_file }}
18 | - source: {{ files_switch(['config.yml.jinja'],
19 | lookup='k8s-server-config-file-install-file-managed'
20 | )
21 | }}
22 | - makedirs: True
23 | {%- if grains.os != 'Windows' %}
24 | - mode: 644
25 | - user: {{ d.identity.rootuser }}
26 | - group: {{ d.identity.rootgroup }}
27 | {%- endif %}
28 | - template: jinja
29 | - context:
30 | config: {{ d.server.config|json }}
31 | - require:
32 | - sls: {{ sls_archive_install if d.server.pkg.use_upstream == 'archive' else sls_package_install }}
33 |
34 | {%- endif %}
35 |
--------------------------------------------------------------------------------
/kubernetes/server/config/init.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .file
6 | - .environ
7 |
--------------------------------------------------------------------------------
/kubernetes/server/init.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- if grains.kernel|lower in ('linux', 'darwin') %}
5 |
6 | include:
7 | - .archive.install
8 | - .package.install
9 | - .config
10 | - .alternatives
11 |
12 | {%- else %}
13 | {%- set tplroot = tpldir.split('/')[0] %}
14 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
15 |
16 | kubernetes-server-archive-install-other:
17 | test.show_notification:
18 | - text: |
19 | The server is unavailable for {{ salt['grains.get']('finger', grains.os_family) }}
20 |
21 | {%- endif %}
22 |
--------------------------------------------------------------------------------
/kubernetes/server/package/clean.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- if d.server.pkg.use_upstream in ('package', 'repo') %}
8 | {%- if grains.os_family|lower in ('redhat', 'debian') %}
9 | {%- if d.server.pkg.use_upstream == 'repo' %}
10 | {%- set sls_repo_clean = tplroot ~ '.package.repo.clean' %}
11 | include:
12 | - {{ sls_repo_clean }}
13 | {%- endif %}
14 |
15 | kubernetes-server-package-clean-pkgs:
16 | pkg.removed:
17 | - names: {{ d.server.pkg.commands|unique|json }}
18 | - reload_modules: true
19 | {%- if d.server.pkg.use_upstream == 'repo' %}
20 | - require:
21 | - pkgrepo: kubernetes-package-repo-absent
22 | {%- endif %}
23 |
24 | {%- endif %}
25 | {%- endif %}
26 |
--------------------------------------------------------------------------------
/kubernetes/server/package/init.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .install
6 |
--------------------------------------------------------------------------------
/kubernetes/server/package/install.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- if d.server.pkg.use_upstream in ('package', 'repo') and grains.os_family|lower in ('redhat', 'debian') %}
8 |
9 | {%- if d.server.pkg.use_upstream == 'repo' %}
10 | {%- set sls_repo_install = tplroot ~ '.package.repo.install' %}
11 | include:
12 | - {{ sls_repo_install }}
13 |
14 | {%- endif %}
15 | {%- if grains.os != 'Windows' %}
16 |
17 | kubernetes-server-package-install-deps:
18 | pkg.installed:
19 | - names: {{ d.pkg.deps|json }}
20 | - require_in:
21 | - pkg: kubernetes-server-package-install-pkgs
22 | {%- endif %}
23 |
24 | kubernetes-server-package-install-pkgs:
25 | pkg.installed:
26 | - names: {{ d.server.pkg.commands|unique|json }}
27 | - runas: {{ d.identity.rootuser }}
28 | - reload_modules: true
29 | {%- if d.server.pkg.use_upstream == 'repo' %}
30 | - require:
31 | - pkgrepo: kubernetes-package-repo-managed
32 | {%- endif %}
33 |
34 | {%- else %}
35 |
36 | kubernetes-server-package-install-other:
37 | test.show_notification:
38 | - text: |
39 | The server package is unavailable for {{ salt['grains.get']('finger', grains.os_family) }}
40 |
41 | {%- endif %}
42 |
--------------------------------------------------------------------------------
/kubernetes/sigs/alternatives/clean.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- if d.linux.altpriority|int > 0 and grains.kernel == 'Linux' and grains.os_family not in ('Arch',) %}
8 | {%- if 'wanted' in d.sigs and d.sigs.wanted %}
9 | {%- for tool in d.sigs.wanted|unique %}
10 | {%- if 'pkg' in d.sigs and tool in d.sigs['pkg'] and d.sigs['pkg'][tool] %}
11 | {%- for cmd in d.sigs['pkg'][tool]['commands']|unique %}
12 |
13 | kubernetes-sigs-{{ tool }}-alternatives-clean-{{ cmd }}:
14 | alternatives.remove:
15 | - name: link-k8s-sigs-{{ tool }}-{{ cmd }}
16 | - path: {{ d.sigs['pkg'][tool]['path'] }}/{{ cmd }}
17 | - onlyif:
18 | - update-alternatives --list |grep ^link-k8s-sigs-{{ tool }}-{{ cmd }}
19 |
20 | {%- endfor %}
21 | {%- endif %}
22 | {%- endfor %}
23 | {%- endif %}
24 | {%- endif %}
25 |
--------------------------------------------------------------------------------
/kubernetes/sigs/alternatives/init.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .install
6 |
--------------------------------------------------------------------------------
/kubernetes/sigs/alternatives/install.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- if d.linux.altpriority|int > 0 and grains.kernel == 'Linux' and grains.os_family not in ('Arch',) %}
8 | {%- set sls_archive_install = tplroot ~ '.sigs.archive.install' %}
9 | {%- set sls_binary_install = tplroot ~ '.sigs.binary.install' %}
10 | include:
11 | - {{ sls_archive_install }}
12 | - {{ sls_binary_install }}
13 |
14 | {%- if 'wanted' in d.sigs and d.sigs.wanted %}
15 | {%- for tool in d.sigs.wanted|unique %}
16 | {%- if tool in d.sigs.pkg and d.sigs.pkg[tool] %}
17 | {%- for cmd in d.sigs.pkg[tool]['commands']|unique %}
18 |
19 |
20 | kubernetes-sigs-{{ tool }}-alternatives-install-bin-{{ cmd }}:
21 | {%- if grains.os_family not in ('Suse', 'Arch') %}
22 | alternatives.install:
23 | - name: link-k8s-sigs-{{ tool }}-{{ cmd }}
24 | - link: /usr/local/bin/{{ cmd }}
25 | - order: 10
26 | - path: {{ d.sigs['pkg'][tool]['path'] }}/{{ cmd }}
27 | - priority: {{ d.linux.altpriority }}
28 | {%- else %}
29 | cmd.run:
30 | - name: update-alternatives --install /usr/local/bin/{{ cmd }} link-k8s-sigs-{{ tool }}-{{ cmd }} {{ d.sigs['pkg'][tool]['path'] }}/{{ cmd }} {{ d.linux.altpriority }} # noqa 204
31 | {%- endif %}
32 |
33 | - onlyif:
34 | - test -f {{ d.sigs['pkg'][tool]['path'] }}/{{ cmd }}
35 | - unless: update-alternatives --list |grep ^link-k8s-sigs-{{ tool }}-{{ cmd }} || false
36 | - require:
37 | - sls: {{ sls_archive_install if d.sigs.pkg[tool]['use_upstream'] == 'archive' else sls_binary_install }}
38 | - require_in:
39 | - alternatives: kubernetes-sigs-{{ tool }}-alternatives-set-bin-{{ cmd }}
40 |
41 | kubernetes-sigs-{{ tool }}-alternatives-set-bin-{{ cmd }}:
42 | alternatives.set:
43 | - unless: {{ grains.os_family in ('Suse', 'Arch') }} || false
44 | - name: link-k8s-sigs-{{ tool }}-{{ cmd }}
45 | - path: {{ d.sigs['pkg'][tool]['path'] }}/{{ cmd }}
46 | - onlyif:
47 | - test -f {{ d.sigs['pkg'][tool]['path'] }}/{{ cmd }}
48 |
49 | {%- endfor %}
50 | {%- endif %}
51 |
52 | {%- endfor %}
53 | {%- endif %}
54 | {%- endif %}
55 |
--------------------------------------------------------------------------------
/kubernetes/sigs/archive/clean.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- if 'wanted' in d.sigs and d.sigs.wanted %}
8 | {%- for tool in d.sigs.wanted|unique %}
9 | {%- if 'pkg' in d.sigs and tool in d.sigs['pkg'] and d.sigs['pkg'][tool] %}
10 |
11 | kubernetes-sigs-archive-{{ tool }}-clean:
12 | file.absent:
13 | - names:
14 | - "{{ d.sigs['pkg'][tool]['path'] }}"
15 | {%- for cmd in d.sigs['pkg'][tool]['commands']|unique %}
16 | - /usr/local/bin/{{ cmd }}
17 | {%- endfor %}
18 | module.run:
19 | - name: file.find
20 | - path: "{{ d.dir.base }}"
21 | - kwargs:
22 | iname: "k8s-sigs-{{ tool }}*"
23 | delete: "d"
24 |
25 | {% endif %}
26 | {%- endfor %}
27 | {%- endif %}
28 |
--------------------------------------------------------------------------------
/kubernetes/sigs/archive/init.sls:
--------------------------------------------------------------------------------
1 | #.-*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .install
6 |
--------------------------------------------------------------------------------
/kubernetes/sigs/archive/install.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 | {%- from tplroot ~ "/files/macros.jinja" import format_kwargs with context %}
7 |
8 | {%- if grains.os|lower != 'windows' %}
9 |
10 | kubernetes-sigs-archive-deps-install:
11 | pkg.installed:
12 | - names: {{ d.pkg.deps|json }}
13 |
14 | {%- endif %}
15 | {%- if 'wanted' in d.sigs and d.sigs.wanted %}
16 | {%- for tool in d.sigs.wanted|unique %}
17 | {%- if 'pkg' in d.sigs and tool in d.sigs['pkg'] and d.sigs['pkg'][tool] %}
18 | {%- set p = d.sigs['pkg'][tool] %}
19 | {%- if p['use_upstream'] == 'archive' and 'archive' in p %}
20 |
21 | kubernetes-sigs-archive-{{ tool }}-install:
22 | file.directory:
23 | - name: {{ p['path'] }}
24 | - clean: {{ d.clean }}
25 | - makedirs: True
26 | - require_in:
27 | - archive: kubernetes-sigs-archive-{{ tool }}-install
28 | {%- if grains.os|lower != 'windows' %}
29 | - require:
30 | - pkg: kubernetes-sigs-archive-deps-install
31 | - mode: 755
32 | - user: {{ d.identity.rootuser }}
33 | - group: {{ d.identity.rootgroup }}
34 | - recurse:
35 | - user
36 | - group
37 | - mode
38 | {%- endif %}
39 | archive.extracted:
40 | {{- format_kwargs(p['archive']) }}
41 | - retry: {{ d.retry_option }}
42 | - enforce_toplevel: false
43 | - trim_output: true
44 | {%- if grains.os|lower != 'windows' %}
45 |
46 | - user: {{ d.identity.rootuser }}
47 | - group: {{ d.identity.rootgroup }}
48 | - recurse:
49 | - user
50 | - group
51 | {%- if d.linux.altpriority|int == 0 or grains.os_family in ('Arch', 'MacOS') %}
52 | {%- for cmd in p['commands']|unique %}
53 |
54 | kubernetes-sigs-archive-{{ tool }}-install-symlink-{{ cmd }}:
55 | file.symlink:
56 | - name: /usr/local/bin/{{ cmd }}
57 | - target: {{ p['path'] }}/{{ cmd }}
58 | - force: True
59 | - onlyif: test -x {{ p['path'] }}/{{ cmd }}
60 | - require:
61 | - archive: kubernetes-sigs-archive-{{ tool }}-install
62 |
63 | {%- endfor %}
64 | {%- endif %}
65 | {%- elif tool in ('kind',) %}
66 | cmd.run:
67 | - name: mv {{ d.dir.base ~ d.div ~ 'bin' ~ d.div }}{{ tool }} {{ d.dir.base ~ d.div ~ 'bin' ~ d.div }}{{ tool }}.exe
68 | - onlyif: test -f {{ d.dir.base ~ d.div ~ 'bin' ~ d.div }}{{ tool }}
69 |
70 | {%- endif %}
71 | {%- endif %}
72 | {%- endif %}
73 | {%- endfor %}
74 | {%- if grains.os|lower == 'windows' %}
75 |
76 | kubernetes-sigs-archive-install-bashrc:
77 | file.replace:
78 | - name: C:\cygwin64\home\{{ d.identity.rootuser }}\.bashrc
79 | - pattern: '^export PATH=${PATH}:/cygdrive/c/kubernetes/bin$'
80 | - repl: 'export PATH=${PATH}:/cygdrive/c/kubernetes/bin'
81 | - append_if_not_found: True
82 | cmd.run:
83 | - name: sed -i -e "s/\r//g" C:\cygwin64\home\{{ d.identity.rootuser }}\.bashrc
84 | - onchanges:
85 | - file: kubernetes-sigs-archive-install-bashrc
86 |
87 | {%- endif %}
88 | {%- endif %}
89 |
--------------------------------------------------------------------------------
/kubernetes/sigs/binary/clean.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- if 'wanted' in d.sigs and d.sigs.wanted %}
8 | {%- for tool in d.sigs.wanted|unique %}
9 | {%- if d.sigs.pkg[tool]['use_upstream'] == 'binary' %}
10 | {%- if 'pkg' in d.sigs and tool in d.sigs['pkg'] and d.sigs['pkg'][tool] %}
11 |
12 | kubernetes-sigs-binary-{{ tool }}-clean:
13 | file.absent:
14 | - names:
15 | - {{ d.sigs['pkg'][tool]['path'] }}
16 | {%- for cmd in d.sigs['pkg'][tool]['commands']|unique %}
17 | - /usr/local/bin/{{ cmd }}
18 | {%- endfor %}
19 | module.run:
20 | - name: file.find
21 | - path: "{{ d.dir.base }}"
22 | - kwargs:
23 | iname: "k8s-sigs-{{ tool }}*"
24 | delete: "d"
25 |
26 | {% endif %}
27 | {% endif %}
28 | {%- endfor %}
29 | {%- endif %}
30 |
--------------------------------------------------------------------------------
/kubernetes/sigs/binary/init.sls:
--------------------------------------------------------------------------------
1 | #.-*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .install
6 |
--------------------------------------------------------------------------------
/kubernetes/sigs/binary/install.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | {%- set tplroot = tpldir.split('/')[0] %}
5 | {%- from tplroot ~ "/map.jinja" import data as d with context %}
6 |
7 | {%- if grains.os|lower != 'windows' %}
8 |
9 | kubernetes-sigs-binary-deps-install:
10 | pkg.installed:
11 | - names: {{ d.pkg.deps|json }}
12 |
13 | {%- endif %}
14 | {%- if 'wanted' in d.sigs and d.sigs.wanted %}
15 | {%- for tool in d.sigs.wanted|unique %}
16 | {%- if 'pkg' in d.sigs and tool in d.sigs['pkg'] and d.sigs['pkg'][tool] %}
17 | {%- if d.sigs.pkg[tool]['use_upstream'] == 'binary' and 'binary' in d.sigs.pkg[tool] %}
18 | {%- set p = d.sigs['pkg'][tool] %}
19 |
20 | kubernetes-sigs-binary-{{ tool }}-install:
21 | file.managed:
22 | - name: {{ p['path'] }}{{ tool }}
23 | - source: {{ p['binary']['source'] }}
24 | {%- if 'source_hash' in p['binary'] and p['binary']['source_hash'] %}
25 | - source_hash: {{ p['binary']['source_hash'] }}
26 | {%- else %}
27 | - skip_verify: True
28 | {%- endif %}
29 | - makedirs: True
30 | - retry: {{ d.retry_option|json }}
31 | {%- if grains.os|lower != 'windows' %}
32 | - mode: '0755'
33 | - require:
34 | - pkg: kubernetes-sigs-binary-deps-install
35 | - user: {{ d.identity.rootuser }}
36 | - group: {{ d.identity.rootgroup }}
37 |
38 | {%- if d.linux.altpriority|int == 0 or grains.os_family in ('Arch', 'MacOS') %}
39 | {%- for cmd in p['commands']|unique %}
40 |
41 | kubernetes-sigs-binary-{{ tool }}-install-symlink-{{ cmd }}:
42 | file.symlink:
43 | - name: /usr/local/bin/{{ cmd }}
44 | - target: {{ p['path'] }}{{ cmd }}
45 | - force: True
46 | - onlyif: test -x {{ p['path'] }}{{ cmd }}
47 | - require:
48 | - file: kubernetes-sigs-binary-{{ tool }}-install
49 |
50 | {%- endfor %}
51 | {%- endif %}
52 | {%- elif tool in ('kind',) %}
53 | cmd.run:
54 | - name: mv {{ d.dir.base ~ d.div ~ 'bin' ~ d.div }}{{ tool }} {{ d.dir.base ~ d.div ~ 'bin' ~ d.div }}{{ tool }}.exe
55 | - onlyif: test -f {{ d.dir.base ~ d.div ~ 'bin' ~ d.div }}{{ tool }}
56 |
57 | {%- endif %}
58 | {%- endif %}
59 | {%- endif %}
60 | {%- endfor %}
61 | {%- if grains.os|lower == 'windows' %}
62 |
63 | kubernetes-sigs-binary-install-bashrc:
64 | file.replace:
65 | - name: C:\cygwin64\home\{{ d.identity.rootuser }}\.bashrc
66 | - pattern: '^export PATH=${PATH}:/cygdrive/c/kubernetes/bin$'
67 | - repl: 'export PATH=${PATH}:/cygdrive/c/kubernetes/bin'
68 | - append_if_not_found: True
69 | cmd.run:
70 | - name: sed -i -e "s/\r//g" C:\cygwin64\home\{{ d.identity.rootuser }}\.bashrc
71 | - onchanges:
72 | - file: kubernetes-sigs-binary-install-bashrc
73 |
74 | {%- endif %}
75 | {%- endif %}
76 |
--------------------------------------------------------------------------------
/kubernetes/sigs/clean.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .binary.clean
6 | - .archive.clean
7 | - .alternatives.clean
8 |
--------------------------------------------------------------------------------
/kubernetes/sigs/init.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=sls
3 |
4 | include:
5 | - .archive
6 | - .binary
7 | - .alternatives
8 |
--------------------------------------------------------------------------------
/pillar.example:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=yaml
3 | ---
4 | # This formula works with no-pillars but here are some example configurations.
5 | # If you want custom values review default.yaml and add desired values below.
6 |
7 | kubernetes:
8 | supported:
9 | - server
10 | - client
11 | - node
12 | - k3s
13 | - operator
14 | - operators
15 | - devlibs
16 | - devtools
17 | - sigs
18 | - crimgr
19 | sigs:
20 | wanted:
21 | - kind
22 | - krew
23 | - kubebuilder
24 | operators:
25 | wanted:
26 | - grafana-operator
27 | - prometheus-operator
28 | - akka-cluster-operator
29 | - istio-operator
30 | devlibs:
31 | wanted:
32 | - java
33 | - python
34 | - csharp
35 | - javascript
36 | - kopf
37 | - k8s
38 | - python
39 | - javascript
40 | operator:
41 | wanted: [] # disabled until fixed
42 | sdk:
43 | wanted:
44 | - ansible-operator
45 | - helm-operator
46 | - operator-sdk
47 | devtools:
48 | wanted:
49 | - audit2rbac
50 | - cue
51 | - devspace
52 | - dive
53 | - istio
54 | - kubectx
55 | - kubens
56 | - kudo
57 | - linkerd2
58 | - minikube
59 | - octant
60 | - skaffold
61 | - stern
62 |
63 | linux:
64 | altpriority: 0
65 |
--------------------------------------------------------------------------------
/pre-commit_semantic-release.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | ###############################################################################
4 | # (A) Update `FORMULA` with `${nextRelease.version}`
5 | ###############################################################################
6 | sed -i -e "s_^\(version:\).*_\1 ${1}_" FORMULA
7 |
8 |
9 | ###############################################################################
10 | # (B) Use `m2r` to convert automatically produced `.md` docs to `.rst`
11 | ###############################################################################
12 |
13 | # Install `m2r`
14 | sudo -H pip install m2r
15 |
16 | # Copy and then convert the `.md` docs
17 | cp ./*.md docs/
18 | cd docs/ || exit 1
19 | m2r --overwrite ./*.md
20 |
21 | # Change excess `H1` headings to `H2` in converted `CHANGELOG.rst`
22 | sed -i -e '/^=.*$/s/=/-/g' CHANGELOG.rst
23 | sed -i -e '1,4s/-/=/g' CHANGELOG.rst
24 |
25 | # Use for debugging output, when required
26 | # cat AUTHORS.rst
27 | # cat CHANGELOG.rst
28 |
29 | # Return back to the main directory
30 | cd .. || exit 1
31 |
--------------------------------------------------------------------------------
/release-rules.js:
--------------------------------------------------------------------------------
1 | // No release is triggered for the types commented out below.
2 | // Commits using these types will be incorporated into the next release.
3 | //
4 | // NOTE: Any changes here must be reflected in `CONTRIBUTING.md`.
5 | module.exports = [
6 | {breaking: true, release: 'major'},
7 | // {type: 'build', release: 'patch'},
8 | // {type: 'chore', release: 'patch'},
9 | // {type: 'ci', release: 'patch'},
10 | {type: 'docs', release: 'patch'},
11 | {type: 'feat', release: 'minor'},
12 | {type: 'fix', release: 'patch'},
13 | {type: 'perf', release: 'patch'},
14 | {type: 'refactor', release: 'patch'},
15 | {type: 'revert', release: 'patch'},
16 | {type: 'style', release: 'patch'},
17 | {type: 'test', release: 'patch'},
18 | ];
19 |
--------------------------------------------------------------------------------
/release.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | branch: 'master',
3 | plugins: [
4 | ['@semantic-release/commit-analyzer', {
5 | preset: 'angular',
6 | releaseRules: './release-rules.js',
7 | }],
8 | '@semantic-release/release-notes-generator',
9 | ['@semantic-release/changelog', {
10 | changelogFile: 'CHANGELOG.md',
11 | changelogTitle: '# Changelog',
12 | }],
13 | ['@semantic-release/exec', {
14 | prepareCmd: 'sh ./pre-commit_semantic-release.sh ${nextRelease.version}',
15 | }],
16 | ['@semantic-release/git', {
17 | assets: ['*.md', 'docs/*.rst', 'FORMULA'],
18 | }],
19 | '@semantic-release/github',
20 | ],
21 | generateNotes: {
22 | preset: 'angular',
23 | writerOpts: {
24 | // Required due to upstream bug preventing all types being displayed.
25 | // Bug: https://github.com/conventional-changelog/conventional-changelog/issues/317
26 | // Fix: https://github.com/conventional-changelog/conventional-changelog/pull/410
27 | transform: (commit, context) => {
28 | const issues = []
29 |
30 | commit.notes.forEach(note => {
31 | note.title = `BREAKING CHANGES`
32 | })
33 |
34 | // NOTE: Any changes here must be reflected in `CONTRIBUTING.md`.
35 | if (commit.type === `feat`) {
36 | commit.type = `Features`
37 | } else if (commit.type === `fix`) {
38 | commit.type = `Bug Fixes`
39 | } else if (commit.type === `perf`) {
40 | commit.type = `Performance Improvements`
41 | } else if (commit.type === `revert`) {
42 | commit.type = `Reverts`
43 | } else if (commit.type === `docs`) {
44 | commit.type = `Documentation`
45 | } else if (commit.type === `style`) {
46 | commit.type = `Styles`
47 | } else if (commit.type === `refactor`) {
48 | commit.type = `Code Refactoring`
49 | } else if (commit.type === `test`) {
50 | commit.type = `Tests`
51 | } else if (commit.type === `build`) {
52 | commit.type = `Build System`
53 | // } else if (commit.type === `chore`) {
54 | // commit.type = `Maintenance`
55 | } else if (commit.type === `ci`) {
56 | commit.type = `Continuous Integration`
57 | } else {
58 | return
59 | }
60 |
61 | if (commit.scope === `*`) {
62 | commit.scope = ``
63 | }
64 |
65 | if (typeof commit.hash === `string`) {
66 | commit.hash = commit.hash.substring(0, 7)
67 | }
68 |
69 | if (typeof commit.subject === `string`) {
70 | let url = context.repository
71 | ? `${context.host}/${context.owner}/${context.repository}`
72 | : context.repoUrl
73 | if (url) {
74 | url = `${url}/issues/`
75 | // Issue URLs.
76 | commit.subject = commit.subject.replace(/#([0-9]+)/g, (_, issue) => {
77 | issues.push(issue)
78 | return `[#${issue}](${url}${issue})`
79 | })
80 | }
81 | if (context.host) {
82 | // User URLs.
83 | commit.subject = commit.subject.replace(/\B@([a-z0-9](?:-?[a-z0-9/]){0,38})/g, (_, username) => {
84 | if (username.includes('/')) {
85 | return `@${username}`
86 | }
87 |
88 | return `[@${username}](${context.host}/${username})`
89 | })
90 | }
91 | }
92 |
93 | // remove references that already appear in the subject
94 | commit.references = commit.references.filter(reference => {
95 | if (issues.indexOf(reference.issue) === -1) {
96 | return true
97 | }
98 |
99 | return false
100 | })
101 |
102 | return commit
103 | },
104 | },
105 | },
106 | };
107 |
--------------------------------------------------------------------------------
/test/integration/alma/README.md:
--------------------------------------------------------------------------------
1 | # InSpec Profile: `alma`
2 |
3 | This shows the implementation of the `alma` InSpec [profile](https://github.com/inspec/inspec/blob/master/docs/profiles.md).
4 |
5 | ## Verify a profile
6 |
7 | InSpec ships with built-in features to verify a profile structure.
8 |
9 | ```bash
10 | $ inspec check alma
11 | Summary
12 | -------
13 | Location: alma
14 | Profile: profile
15 | Controls: 4
16 | Timestamp: 2019-06-24T23:09:01+00:00
17 | Valid: true
18 |
19 | Errors
20 | ------
21 |
22 | Warnings
23 | --------
24 | ```
25 |
26 | ## Execute a profile
27 |
28 | To run all **supported** controls on a local machine use `inspec exec /path/to/profile`.
29 |
30 | ```bash
31 | $ inspec exec alma
32 | ..
33 |
34 | Finished in 0.0025 seconds (files took 0.12449 seconds to load)
35 | 8 examples, 0 failures
36 | ```
37 |
38 | ## Execute a specific control from a profile
39 |
40 | To run one control from the profile use `inspec exec /path/to/profile --controls name`.
41 |
42 | ```bash
43 | $ inspec exec alma --controls package
44 | .
45 |
46 | Finished in 0.0025 seconds (files took 0.12449 seconds to load)
47 | 1 examples, 0 failures
48 | ```
49 |
50 | See an [example control here](https://github.com/inspec/inspec/blob/master/examples/profile/controls/example.rb).
51 |
--------------------------------------------------------------------------------
/test/integration/alma/controls/default_spec.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | title 'kubernetes archives profile'
4 |
5 | control 'kubernetes archive' do
6 | impact 1.0
7 | title 'should be installed'
8 |
9 | describe file('/usr/local/k8s-server-1.22.1/bin') do
10 | it { should exist }
11 | it { should be_directory }
12 | its('type') { should eq :directory }
13 | end
14 | describe file('/usr/local/k8s-server-1.22.1/bin/kubeadm') do
15 | it { should exist }
16 | its('mode') { should cmp '0755' }
17 | end
18 | describe file('/usr/local/k8s-server-1.22.1/bin/apiextensions-apiserver') do
19 | it { should exist }
20 | its('mode') { should cmp '0755' }
21 | end
22 | describe file('/usr/local/k8s-server-1.22.1/bin/mounter') do
23 | it { should exist }
24 | its('mode') { should cmp '0755' }
25 | end
26 | describe file('/usr/local/k8s-server-1.22.1/bin/kube-controller-manager') do
27 | it { should exist }
28 | its('mode') { should cmp '0755' }
29 | end
30 | describe file('/usr/local/k8s-server-1.22.1/bin/kubelet') do
31 | it { should exist }
32 | its('mode') { should cmp '0755' }
33 | end
34 | describe file('/usr/local/k8s-server-1.22.1/bin/kube-apiserver') do
35 | it { should exist }
36 | its('mode') { should cmp '0755' }
37 | end
38 | describe file('/usr/local/k8s-server-1.22.1/bin/kube-proxy') do
39 | it { should exist }
40 | its('mode') { should cmp '0755' }
41 | end
42 | describe file('/usr/local/k8s-server-1.22.1/bin/kube-scheduler') do
43 | it { should exist }
44 | its('mode') { should cmp '0755' }
45 | end
46 | describe file('/usr/local/k8s-server-1.22.1/bin/kubectl') do
47 | it { should exist }
48 | its('mode') { should cmp '0755' }
49 | end
50 | describe file('/usr/local/k8s-server-1.22.1/bin/kubectl') do
51 | it { should exist }
52 | its('mode') { should cmp '0755' }
53 | end
54 | describe file('/usr/local/k8s-server-1.22.1/bin/kubectl') do
55 | it { should exist }
56 | its('mode') { should cmp '0755' }
57 | end
58 | describe file('/usr/local/k8s-node-1.22.1/bin') do
59 | it { should exist }
60 | it { should be_directory }
61 | its('type') { should eq :directory }
62 | end
63 | describe file('/usr/local/k8s-node-1.22.1/bin/kubeadm') do
64 | it { should exist }
65 | it { should be_file }
66 | it { should_not be_directory }
67 | end
68 | describe file('/usr/local/k8s-node-1.22.1/bin/kubectl') do
69 | it { should exist }
70 | it { should be_file }
71 | it { should_not be_directory }
72 | end
73 | describe file('/usr/local/k8s-node-1.22.1/bin/kube-proxy') do
74 | it { should exist }
75 | it { should be_file }
76 | it { should_not be_directory }
77 | end
78 | describe file('/usr/local/k8s-node-1.22.1/bin/kubelet') do
79 | it { should exist }
80 | it { should be_file }
81 | it { should_not be_directory }
82 | end
83 | describe file('/usr/local/k8s-node-1.22.1/bin') do
84 | it { should exist }
85 | it { should be_directory }
86 | its('type') { should eq :directory }
87 | end
88 | describe file('/usr/local/k8s-sigs-kind-0.11.1/bin') do
89 | it { should exist }
90 | it { should be_directory }
91 | its('type') { should eq :directory }
92 | end
93 | describe file('/usr/local/k8s-sigs-kind-0.11.1/bin/kind') do
94 | it { should exist }
95 | its('mode') { should cmp '0755' }
96 | end
97 | describe file('/usr/local/opt/intel/bin/cri-resmgr') do
98 | it { should exist }
99 | its('mode') { should cmp '0755' }
100 | end
101 | describe file('/usr/local/k8s-devtools-stern-1.11.0/bin/stern') do
102 | it { should exist }
103 | its('mode') { should cmp '0755' }
104 | end
105 | describe file('/usr/local/k8s-node-1.22.1/bin/kubectl') do
106 | it { should exist }
107 | its('mode') { should cmp '0755' }
108 | end
109 | describe file('/usr/local/k8s-client-1.22.1/bin') do
110 | it { should exist }
111 | it { should be_directory }
112 | its('type') { should eq :directory }
113 | end
114 | describe file('/usr/local/k8s-client-1.22.1/bin/kubectl') do
115 | it { should exist }
116 | its('mode') { should cmp '0755' }
117 | end
118 | describe file('/usr/local/k8s-devtools-minikube-1.23.0/bin') do
119 | it { should exist }
120 | it { should be_directory }
121 | its('type') { should eq :directory }
122 | end
123 | describe file('/usr/local/k8s-devtools-minikube-1.23.0/bin/minikube') do
124 | it { should exist }
125 | its('mode') { should cmp '0755' }
126 | end
127 | describe file('/usr/local/k8s-devtools-devspace-5.15.0/bin') do
128 | it { should exist }
129 | it { should be_directory }
130 | its('type') { should eq :directory }
131 | end
132 | describe file('/usr/local/k8s-devtools-devspace-5.15.0/bin/devspace') do
133 | it { should exist }
134 | its('mode') { should cmp '0755' }
135 | end
136 | describe file('/usr/local/k8s-k3s-v1.21.4+k3s1/bin/k3s') do
137 | it { should exist }
138 | it { should_not be_directory }
139 | its('type') { should eq :file }
140 | end
141 | describe file('/usr/local/bin/k3s') do
142 | it { should be_file }
143 | it { should_not be_directory }
144 | end
145 | describe file('/usr/local/k8s-devtools-kudo-0.19.0/bin/kudo') do
146 | it { should_not be_symlink }
147 | it { should be_file }
148 | it { should_not be_directory }
149 | end
150 | describe file('/usr/local/bin/kudo') do
151 | it { should be_file }
152 | it { should_not be_directory }
153 | end
154 | describe file('/usr/local/k8s-sigs-kubebuilder-3.1.0/bin/kubebuilder') do
155 | it { should_not be_symlink }
156 | it { should be_file }
157 | it { should_not be_directory }
158 | end
159 | describe file('/usr/local/k8s-devtools-istio-1.11.2/bin/istioctl') do
160 | it { should_not be_symlink }
161 | # it { should be_file }
162 | it { should_not be_directory }
163 | end
164 | describe file('/usr/local/k8s-devtools-kubectx-0.9.4/bin/kubectx') do
165 | it { should_not be_symlink }
166 | it { should be_file }
167 | it { should_not be_directory }
168 | end
169 | describe file('/usr/local/k8s-devtools-kubens-0.9.4/bin/kubens') do
170 | it { should_not be_symlink }
171 | it { should be_file }
172 | it { should_not be_directory }
173 | end
174 | describe file('/usr/local/k8s-devtools-cue-v0.4.0/bin/cue') do
175 | it { should_not be_symlink }
176 | it { should be_file }
177 | it { should_not be_directory }
178 | end
179 | describe file('/usr/local/k8s-devtools-linkerd2-21.9.1') do
180 | it { should be_directory }
181 | end
182 | describe file('/usr/local/k8s-devtools-linkerd2-21.9.1/bin/linkerd2') do
183 | it { should_not be_symlink }
184 | it { should be_file }
185 | it { should_not be_directory }
186 | end
187 | describe file('/usr/local/k8s-devtools-audit2rbac-0.8.0') do
188 | it { should be_directory }
189 | end
190 | describe file('/usr/local/k8s-devtools-audit2rbac-0.8.0/bin/audit2rbac') do
191 | it { should_not be_symlink }
192 | it { should be_file }
193 | it { should_not be_directory }
194 | end
195 | describe file('/usr/local/k8s-devtools-octant-0.23.0/bin/octant') do
196 | it { should_not be_symlink }
197 | it { should be_file }
198 | it { should_not be_directory }
199 | end
200 | describe file('/usr/local/k8s-devtools-skaffold-1.31.0/bin/skaffold') do
201 | it { should be_file }
202 | end
203 | describe file('/usr/local/k8s-devtools-dive-0.10.0/bin/dive') do
204 | # it { should be_file }
205 | it { should_not be_directory }
206 | end
207 | describe file('/usr/local/k8s-devtools-dive-0.10.0') do
208 | it { should be_directory }
209 | end
210 | describe file('/usr/local/k8s-sigs-krew-0.4.1') do
211 | it { should be_directory }
212 | end
213 | describe file('/etc/default/kubernetes-aliases.sh') do
214 | it { should be_file }
215 | end
216 | describe file('/usr/local/src/k8s/libs/k8s-devlibs-kopf-0.27') do
217 | it { should be_directory }
218 | end
219 | describe file('/usr/local/src/k8s/libs/k8s-devlibs-csharp-1.2.0') do
220 | it { should be_directory }
221 | end
222 | describe file('/usr/local/src/k8s/libs/k8s-devlibs-python-18.20.0') do
223 | it { should be_directory }
224 | end
225 | describe file('/usr/local/src/k8s/libs/k8s-devlibs-java-13.0.0') do
226 | it { should be_directory }
227 | end
228 | describe file('/usr/local/src/k8s/libs/k8s-devlibs-javascript-0.15.0') do
229 | it { should be_directory }
230 | end
231 | # describe file('/usr/local/bin/ansible-operator') do
232 | # it { should exist }
233 | # its('mode') { should cmp '0755' }
234 | # end
235 | # describe file('/usr/local/bin/helm-operator') do
236 | # it { should exist }
237 | # its('mode') { should cmp '0755' }
238 | # end
239 | # describe file('/usr/local/bin/operator-sdk') do
240 | # it { should exist }
241 | # its('mode') { should cmp '0755' }
242 | # end
243 | describe file('/usr/local/src/k8s/libs/k8s-operators-istio-operator-0.10.6') do
244 | it { should be_directory }
245 | end
246 | describe file('/usr/local/src/k8s/libs/k8s-operators-akka-cluster-operator-1.0.3') do
247 | it { should be_directory }
248 | end
249 | describe file('/usr/local/src/k8s/libs/k8s-operators-prometheus-operator-0.50.0') do
250 | it { should be_directory }
251 | end
252 | describe file('/usr/local/src/k8s/libs/k8s-operators-grafana-operator-3.10.3') do
253 | it { should be_directory }
254 | end
255 | end
256 |
--------------------------------------------------------------------------------
/test/integration/alma/inspec.yml:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=yaml
3 | ---
4 | name: alma
5 | title: kubernetes formula
6 | maintainer: SaltStack Formulas
7 | license: Apache-2.0
8 | summary: Verify that the kubernetes formula is setup and configured correctly
9 | supports:
10 | - platform-name: centos
11 | - platform-name: fedora
12 |
--------------------------------------------------------------------------------
/test/integration/arch/README.md:
--------------------------------------------------------------------------------
1 | # InSpec Profile: `default`
2 |
3 | This shows the implementation of the `default` InSpec [profile](https://github.com/inspec/inspec/blob/master/docs/profiles.md).
4 |
5 | ## Verify a profile
6 |
7 | InSpec ships with built-in features to verify a profile structure.
8 |
9 | ```bash
10 | $ inspec check default
11 | Summary
12 | -------
13 | Location: default
14 | Profile: profile
15 | Controls: 4
16 | Timestamp: 2019-06-24T23:09:01+00:00
17 | Valid: true
18 |
19 | Errors
20 | ------
21 |
22 | Warnings
23 | --------
24 | ```
25 |
26 | ## Execute a profile
27 |
28 | To run all **supported** controls on a local machine use `inspec exec /path/to/profile`.
29 |
30 | ```bash
31 | $ inspec exec default
32 | ..
33 |
34 | Finished in 0.0025 seconds (files took 0.12449 seconds to load)
35 | 8 examples, 0 failures
36 | ```
37 |
38 | ## Execute a specific control from a profile
39 |
40 | To run one control from the profile use `inspec exec /path/to/profile --controls name`.
41 |
42 | ```bash
43 | $ inspec exec default --controls package
44 | .
45 |
46 | Finished in 0.0025 seconds (files took 0.12449 seconds to load)
47 | 1 examples, 0 failures
48 | ```
49 |
50 | See an [example control here](https://github.com/inspec/inspec/blob/master/examples/profile/controls/example.rb).
51 |
--------------------------------------------------------------------------------
/test/integration/arch/controls/default_spec.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | title 'kubernetes archives profile'
4 |
5 | control 'kubernetes archive' do
6 | impact 1.0
7 | title 'should be installed'
8 |
9 | describe file('/usr/local/k8s-server-1.22.1/bin') do
10 | it { should exist }
11 | it { should be_directory }
12 | its('type') { should eq :directory }
13 | end
14 | describe file('/usr/local/k8s-server-1.22.1/bin/kubeadm') do
15 | it { should exist }
16 | its('mode') { should cmp '0755' }
17 | end
18 | describe file('/usr/local/k8s-server-1.22.1/bin/apiextensions-apiserver') do
19 | it { should exist }
20 | its('mode') { should cmp '0755' }
21 | end
22 | describe file('/usr/local/k8s-server-1.22.1/bin/mounter') do
23 | it { should exist }
24 | its('mode') { should cmp '0755' }
25 | end
26 | describe file('/usr/local/k8s-server-1.22.1/bin/kube-controller-manager') do
27 | it { should exist }
28 | its('mode') { should cmp '0755' }
29 | end
30 | describe file('/usr/local/k8s-server-1.22.1/bin/kubelet') do
31 | it { should exist }
32 | its('mode') { should cmp '0755' }
33 | end
34 | describe file('/usr/local/k8s-server-1.22.1/bin/kube-apiserver') do
35 | it { should exist }
36 | its('mode') { should cmp '0755' }
37 | end
38 | describe file('/usr/local/k8s-server-1.22.1/bin/kube-proxy') do
39 | it { should exist }
40 | its('mode') { should cmp '0755' }
41 | end
42 | describe file('/usr/local/k8s-server-1.22.1/bin/kube-scheduler') do
43 | it { should exist }
44 | its('mode') { should cmp '0755' }
45 | end
46 | describe file('/usr/local/k8s-server-1.22.1/bin/kubectl') do
47 | it { should exist }
48 | its('mode') { should cmp '0755' }
49 | end
50 | describe file('/usr/local/k8s-server-1.22.1/bin/kubectl') do
51 | it { should exist }
52 | its('mode') { should cmp '0755' }
53 | end
54 | describe file('/usr/local/k8s-server-1.22.1/bin/kubectl') do
55 | it { should exist }
56 | its('mode') { should cmp '0755' }
57 | end
58 | describe file('/usr/local/k8s-node-1.22.1/bin') do
59 | it { should exist }
60 | it { should be_directory }
61 | its('type') { should eq :directory }
62 | end
63 | describe file('/usr/local/k8s-node-1.22.1/bin/kubeadm') do
64 | it { should exist }
65 | it { should be_file }
66 | it { should_not be_directory }
67 | end
68 | describe file('/usr/local/k8s-node-1.22.1/bin/kubectl') do
69 | it { should exist }
70 | it { should be_file }
71 | it { should_not be_directory }
72 | end
73 | describe file('/usr/local/k8s-node-1.22.1/bin/kube-proxy') do
74 | it { should exist }
75 | it { should be_file }
76 | it { should_not be_directory }
77 | end
78 | describe file('/usr/local/k8s-node-1.22.1/bin/kubelet') do
79 | it { should exist }
80 | it { should be_file }
81 | it { should_not be_directory }
82 | end
83 | describe file('/usr/local/k8s-node-1.22.1/bin') do
84 | it { should exist }
85 | it { should be_directory }
86 | its('type') { should eq :directory }
87 | end
88 | describe file('/usr/local/k8s-sigs-kind-0.11.1/bin') do
89 | it { should exist }
90 | it { should be_directory }
91 | its('type') { should eq :directory }
92 | end
93 | describe file('/usr/local/k8s-sigs-kind-0.11.1/bin/kind') do
94 | it { should exist }
95 | its('mode') { should cmp '0755' }
96 | end
97 | describe file('/usr/local/opt/intel/bin/cri-resmgr') do
98 | it { should exist }
99 | its('mode') { should cmp '0755' }
100 | end
101 | describe file('/usr/local/k8s-devtools-stern-1.11.0/bin/stern') do
102 | it { should exist }
103 | its('mode') { should cmp '0755' }
104 | end
105 | describe file('/usr/local/k8s-node-1.22.1/bin/kubectl') do
106 | it { should exist }
107 | its('mode') { should cmp '0755' }
108 | end
109 | describe file('/usr/local/k8s-client-1.22.1/bin') do
110 | it { should exist }
111 | it { should be_directory }
112 | its('type') { should eq :directory }
113 | end
114 | describe file('/usr/local/k8s-client-1.22.1/bin/kubectl') do
115 | it { should exist }
116 | its('mode') { should cmp '0755' }
117 | end
118 | describe file('/usr/local/k8s-devtools-minikube-1.23.0/bin') do
119 | it { should exist }
120 | it { should be_directory }
121 | its('type') { should eq :directory }
122 | end
123 | describe file('/usr/local/k8s-devtools-minikube-1.23.0/bin/minikube') do
124 | it { should exist }
125 | its('mode') { should cmp '0755' }
126 | end
127 | describe file('/usr/local/k8s-devtools-devspace-5.15.0/bin') do
128 | it { should exist }
129 | it { should be_directory }
130 | its('type') { should eq :directory }
131 | end
132 | describe file('/usr/local/k8s-devtools-devspace-5.15.0/bin/devspace') do
133 | it { should exist }
134 | its('mode') { should cmp '0755' }
135 | end
136 | describe file('/usr/local/k8s-k3s-v1.21.4+k3s1/bin/k3s') do
137 | it { should exist }
138 | it { should_not be_directory }
139 | its('type') { should eq :file }
140 | end
141 | describe file('/usr/local/bin/k3s') do
142 | it { should be_file }
143 | it { should_not be_directory }
144 | end
145 | describe file('/usr/local/k8s-devtools-kudo-0.19.0/bin/kudo') do
146 | it { should_not be_symlink }
147 | it { should be_file }
148 | it { should_not be_directory }
149 | end
150 | describe file('/usr/local/bin/kudo') do
151 | # it { should be_file }
152 | it { should_not be_directory }
153 | end
154 | describe file('/usr/local/k8s-sigs-kubebuilder-3.1.0/bin/kubebuilder') do
155 | it { should_not be_symlink }
156 | it { should be_file }
157 | it { should_not be_directory }
158 | end
159 | describe file('/usr/local/k8s-devtools-istio-1.11.2/bin/istioctl') do
160 | it { should_not be_symlink }
161 | # it { should be_file }
162 | it { should_not be_directory }
163 | end
164 | describe file('/usr/local/k8s-devtools-kubectx-0.9.4/bin/kubectx') do
165 | it { should_not be_symlink }
166 | it { should be_file }
167 | it { should_not be_directory }
168 | end
169 | describe file('/usr/local/k8s-devtools-kubens-0.9.4/bin/kubens') do
170 | it { should_not be_symlink }
171 | it { should be_file }
172 | it { should_not be_directory }
173 | end
174 | describe file('/usr/local/k8s-devtools-cue-v0.4.0/bin/cue') do
175 | it { should_not be_symlink }
176 | it { should be_file }
177 | it { should_not be_directory }
178 | end
179 | describe file('/usr/local/k8s-devtools-linkerd2-21.9.1') do
180 | it { should be_directory }
181 | end
182 | describe file('/usr/local/k8s-devtools-linkerd2-21.9.1/bin/linkerd2') do
183 | it { should_not be_symlink }
184 | it { should be_file }
185 | it { should_not be_directory }
186 | end
187 | describe file('/usr/local/k8s-devtools-audit2rbac-0.8.0') do
188 | it { should be_directory }
189 | end
190 | describe file('/usr/local/k8s-devtools-audit2rbac-0.8.0/bin/audit2rbac') do
191 | it { should_not be_symlink }
192 | it { should be_file }
193 | it { should_not be_directory }
194 | end
195 | describe file('/usr/local/k8s-devtools-octant-0.23.0/bin/octant') do
196 | it { should_not be_symlink }
197 | it { should be_file }
198 | it { should_not be_directory }
199 | end
200 | describe file('/usr/local/k8s-devtools-skaffold-1.31.0/bin/skaffold') do
201 | it { should be_file }
202 | end
203 | describe file('/usr/local/k8s-devtools-dive-0.10.0/bin/dive') do
204 | # it { should be_file }
205 | it { should_not be_directory }
206 | end
207 | describe file('/usr/local/k8s-devtools-dive-0.10.0') do
208 | it { should be_directory }
209 | end
210 | describe file('/usr/local/k8s-sigs-krew-0.4.1') do
211 | it { should be_directory }
212 | end
213 | describe file('/etc/default/kubernetes-aliases.sh') do
214 | it { should be_file }
215 | end
216 | describe file('/usr/local/src/k8s/libs/k8s-devlibs-kopf-0.27') do
217 | it { should be_directory }
218 | end
219 | describe file('/usr/local/src/k8s/libs/k8s-devlibs-csharp-1.2.0') do
220 | it { should be_directory }
221 | end
222 | describe file('/usr/local/src/k8s/libs/k8s-devlibs-python-18.20.0') do
223 | it { should be_directory }
224 | end
225 | describe file('/usr/local/src/k8s/libs/k8s-devlibs-java-13.0.0') do
226 | it { should be_directory }
227 | end
228 | describe file('/usr/local/src/k8s/libs/k8s-devlibs-javascript-0.15.0') do
229 | it { should be_directory }
230 | end
231 | # describe file('/usr/local/bin/ansible-operator') do
232 | # it { should exist }
233 | # its('mode') { should cmp '0755' }
234 | # end
235 | # describe file('/usr/local/bin/helm-operator') do
236 | # it { should exist }
237 | # its('mode') { should cmp '0755' }
238 | # end
239 | # describe file('/usr/local/bin/operator-sdk') do
240 | # it { should exist }
241 | # its('mode') { should cmp '0755' }
242 | # end
243 | describe file('/usr/local/src/k8s/libs/k8s-operators-istio-operator-0.10.6') do
244 | it { should be_directory }
245 | end
246 | describe file('/usr/local/src/k8s/libs/k8s-operators-akka-cluster-operator-1.0.3') do
247 | it { should be_directory }
248 | end
249 | describe file('/usr/local/src/k8s/libs/k8s-operators-prometheus-operator-0.50.0') do
250 | it { should be_directory }
251 | end
252 | describe file('/usr/local/src/k8s/libs/k8s-operators-grafana-operator-3.10.3') do
253 | it { should be_directory }
254 | end
255 | end
256 |
--------------------------------------------------------------------------------
/test/integration/arch/inspec.yml:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=yaml
3 | ---
4 | name: arch
5 | title: kubernetes formula
6 | maintainer: SaltStack Formulas
7 | license: Apache-2.0
8 | summary: Verify that the kubernetes formula is setup and configured correctly
9 | supports:
10 | - platform-name: arch
11 |
--------------------------------------------------------------------------------
/test/integration/default/README.md:
--------------------------------------------------------------------------------
1 | # InSpec Profile: `default`
2 |
3 | This shows the implementation of the `default` InSpec [profile](https://github.com/inspec/inspec/blob/master/docs/profiles.md).
4 |
5 | ## Verify a profile
6 |
7 | InSpec ships with built-in features to verify a profile structure.
8 |
9 | ```bash
10 | $ inspec check default
11 | Summary
12 | -------
13 | Location: default
14 | Profile: profile
15 | Controls: 4
16 | Timestamp: 2019-06-24T23:09:01+00:00
17 | Valid: true
18 |
19 | Errors
20 | ------
21 |
22 | Warnings
23 | --------
24 | ```
25 |
26 | ## Execute a profile
27 |
28 | To run all **supported** controls on a local machine use `inspec exec /path/to/profile`.
29 |
30 | ```bash
31 | $ inspec exec default
32 | ..
33 |
34 | Finished in 0.0025 seconds (files took 0.12449 seconds to load)
35 | 8 examples, 0 failures
36 | ```
37 |
38 | ## Execute a specific control from a profile
39 |
40 | To run one control from the profile use `inspec exec /path/to/profile --controls name`.
41 |
42 | ```bash
43 | $ inspec exec default --controls package
44 | .
45 |
46 | Finished in 0.0025 seconds (files took 0.12449 seconds to load)
47 | 1 examples, 0 failures
48 | ```
49 |
50 | See an [example control here](https://github.com/inspec/inspec/blob/master/examples/profile/controls/example.rb).
51 |
--------------------------------------------------------------------------------
/test/integration/default/controls/default_spec.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | title 'kubernetes archives profile'
4 |
5 | control 'kubernetes archive' do
6 | impact 1.0
7 | title 'should be installed'
8 |
9 | describe file('/usr/local/k8s-server-1.22.1/bin') do
10 | it { should exist }
11 | it { should be_directory }
12 | its('type') { should eq :directory }
13 | end
14 | describe file('/usr/local/k8s-server-1.22.1/bin/kubeadm') do
15 | it { should exist }
16 | its('mode') { should cmp '0755' }
17 | end
18 | describe file('/usr/local/k8s-server-1.22.1/bin/apiextensions-apiserver') do
19 | it { should exist }
20 | its('mode') { should cmp '0755' }
21 | end
22 | describe file('/usr/local/k8s-server-1.22.1/bin/mounter') do
23 | it { should exist }
24 | its('mode') { should cmp '0755' }
25 | end
26 | describe file('/usr/local/k8s-server-1.22.1/bin/kube-controller-manager') do
27 | it { should exist }
28 | its('mode') { should cmp '0755' }
29 | end
30 | describe file('/usr/local/k8s-server-1.22.1/bin/kubelet') do
31 | it { should exist }
32 | its('mode') { should cmp '0755' }
33 | end
34 | describe file('/usr/local/k8s-server-1.22.1/bin/kube-apiserver') do
35 | it { should exist }
36 | its('mode') { should cmp '0755' }
37 | end
38 | describe file('/usr/local/k8s-server-1.22.1/bin/kube-proxy') do
39 | it { should exist }
40 | its('mode') { should cmp '0755' }
41 | end
42 | describe file('/usr/local/k8s-server-1.22.1/bin/kube-scheduler') do
43 | it { should exist }
44 | its('mode') { should cmp '0755' }
45 | end
46 | describe file('/usr/local/k8s-server-1.22.1/bin/kubectl') do
47 | it { should exist }
48 | its('mode') { should cmp '0755' }
49 | end
50 | describe file('/usr/local/k8s-server-1.22.1/bin/kubectl') do
51 | it { should exist }
52 | its('mode') { should cmp '0755' }
53 | end
54 | describe file('/usr/local/k8s-server-1.22.1/bin/kubectl') do
55 | it { should exist }
56 | its('mode') { should cmp '0755' }
57 | end
58 | describe file('/usr/local/k8s-node-1.22.1/bin') do
59 | it { should exist }
60 | it { should be_directory }
61 | its('type') { should eq :directory }
62 | end
63 | describe file('/usr/local/k8s-node-1.22.1/bin/kubeadm') do
64 | it { should exist }
65 | it { should be_file }
66 | it { should_not be_directory }
67 | end
68 | describe file('/usr/local/k8s-node-1.22.1/bin/kubectl') do
69 | it { should exist }
70 | it { should be_file }
71 | it { should_not be_directory }
72 | end
73 | describe file('/usr/local/k8s-node-1.22.1/bin/kube-proxy') do
74 | it { should exist }
75 | it { should be_file }
76 | it { should_not be_directory }
77 | end
78 | describe file('/usr/local/k8s-node-1.22.1/bin/kubelet') do
79 | it { should exist }
80 | it { should be_file }
81 | it { should_not be_directory }
82 | end
83 | describe file('/usr/local/k8s-node-1.22.1/bin') do
84 | it { should exist }
85 | it { should be_directory }
86 | its('type') { should eq :directory }
87 | end
88 | describe file('/usr/local/k8s-sigs-kind-0.11.1/bin') do
89 | it { should exist }
90 | it { should be_directory }
91 | its('type') { should eq :directory }
92 | end
93 | describe file('/usr/local/k8s-sigs-kind-0.11.1/bin/kind') do
94 | it { should exist }
95 | its('mode') { should cmp '0755' }
96 | end
97 | describe file('/usr/local/opt/intel/bin/cri-resmgr') do
98 | it { should exist }
99 | its('mode') { should cmp '0755' }
100 | end
101 | describe file('/usr/local/k8s-devtools-stern-1.11.0/bin/stern') do
102 | it { should exist }
103 | its('mode') { should cmp '0755' }
104 | end
105 | describe file('/usr/local/k8s-node-1.22.1/bin/kubectl') do
106 | it { should exist }
107 | its('mode') { should cmp '0755' }
108 | end
109 | describe file('/usr/local/k8s-client-1.22.1/bin') do
110 | it { should exist }
111 | it { should be_directory }
112 | its('type') { should eq :directory }
113 | end
114 | describe file('/usr/local/k8s-client-1.22.1/bin/kubectl') do
115 | it { should exist }
116 | its('mode') { should cmp '0755' }
117 | end
118 | describe file('/usr/local/k8s-devtools-minikube-1.23.0/bin') do
119 | it { should exist }
120 | it { should be_directory }
121 | its('type') { should eq :directory }
122 | end
123 | describe file('/usr/local/k8s-devtools-minikube-1.23.0/bin/minikube') do
124 | it { should exist }
125 | its('mode') { should cmp '0755' }
126 | end
127 | describe file('/usr/local/k8s-devtools-devspace-5.15.0/bin') do
128 | it { should exist }
129 | it { should be_directory }
130 | its('type') { should eq :directory }
131 | end
132 | describe file('/usr/local/k8s-devtools-devspace-5.15.0/bin/devspace') do
133 | it { should exist }
134 | its('mode') { should cmp '0755' }
135 | end
136 | describe file('/usr/local/k8s-k3s-v1.21.4+k3s1/bin/k3s') do
137 | it { should exist }
138 | it { should_not be_directory }
139 | its('type') { should eq :file }
140 | end
141 | describe file('/usr/local/bin/k3s') do
142 | it { should be_file }
143 | it { should_not be_directory }
144 | end
145 | describe file('/usr/local/k8s-devtools-kudo-0.19.0/bin/kudo') do
146 | it { should_not be_symlink }
147 | it { should be_file }
148 | it { should_not be_directory }
149 | end
150 | describe file('/usr/local/bin/kudo') do
151 | it { should be_file }
152 | it { should_not be_directory }
153 | end
154 | describe file('/usr/local/k8s-sigs-kubebuilder-3.1.0/bin/kubebuilder') do
155 | it { should_not be_symlink }
156 | it { should be_file }
157 | it { should_not be_directory }
158 | end
159 | describe file('/usr/local/k8s-devtools-istio-1.11.2/bin/istioctl') do
160 | it { should_not be_symlink }
161 | # it { should be_file }
162 | it { should_not be_directory }
163 | end
164 | describe file('/usr/local/k8s-devtools-kubectx-0.9.4/bin/kubectx') do
165 | it { should_not be_symlink }
166 | it { should be_file }
167 | it { should_not be_directory }
168 | end
169 | describe file('/usr/local/k8s-devtools-kubens-0.9.4/bin/kubens') do
170 | it { should_not be_symlink }
171 | it { should be_file }
172 | it { should_not be_directory }
173 | end
174 | describe file('/usr/local/k8s-devtools-cue-v0.4.0/bin/cue') do
175 | it { should_not be_symlink }
176 | it { should be_file }
177 | it { should_not be_directory }
178 | end
179 | describe file('/usr/local/k8s-devtools-linkerd2-21.9.1') do
180 | it { should be_directory }
181 | end
182 | describe file('/usr/local/k8s-devtools-linkerd2-21.9.1/bin/linkerd2') do
183 | it { should_not be_symlink }
184 | it { should be_file }
185 | it { should_not be_directory }
186 | end
187 | describe file('/usr/local/k8s-devtools-audit2rbac-0.8.0') do
188 | it { should be_directory }
189 | end
190 | describe file('/usr/local/k8s-devtools-audit2rbac-0.8.0/bin/audit2rbac') do
191 | it { should_not be_symlink }
192 | it { should be_file }
193 | it { should_not be_directory }
194 | end
195 | describe file('/usr/local/k8s-devtools-octant-0.23.0/bin/octant') do
196 | it { should_not be_symlink }
197 | it { should be_file }
198 | it { should_not be_directory }
199 | end
200 | describe file('/usr/local/k8s-devtools-skaffold-1.31.0/bin/skaffold') do
201 | it { should be_file }
202 | end
203 | describe file('/usr/local/k8s-devtools-dive-0.10.0/bin/dive') do
204 | # it { should be_file }
205 | it { should_not be_directory }
206 | end
207 | describe file('/usr/local/k8s-devtools-dive-0.10.0') do
208 | it { should be_directory }
209 | end
210 | describe file('/usr/local/k8s-sigs-krew-0.4.1') do
211 | it { should be_directory }
212 | end
213 | describe file('/etc/default/kubernetes-aliases.sh') do
214 | it { should be_file }
215 | end
216 | describe file('/usr/local/src/k8s/libs/k8s-devlibs-kopf-0.27') do
217 | it { should be_directory }
218 | end
219 | describe file('/usr/local/src/k8s/libs/k8s-devlibs-csharp-1.2.0') do
220 | it { should be_directory }
221 | end
222 | describe file('/usr/local/src/k8s/libs/k8s-devlibs-python-18.20.0') do
223 | it { should be_directory }
224 | end
225 | describe file('/usr/local/src/k8s/libs/k8s-devlibs-java-13.0.0') do
226 | it { should be_directory }
227 | end
228 | describe file('/usr/local/src/k8s/libs/k8s-devlibs-javascript-0.15.0') do
229 | it { should be_directory }
230 | end
231 | # describe file('/usr/local/bin/ansible-operator') do
232 | # it { should exist }
233 | # its('mode') { should cmp '0755' }
234 | # end
235 | # describe file('/usr/local/bin/helm-operator') do
236 | # it { should exist }
237 | # its('mode') { should cmp '0755' }
238 | # end
239 | # describe file('/usr/local/bin/operator-sdk') do
240 | # it { should exist }
241 | # its('mode') { should cmp '0755' }
242 | # end
243 | describe file('/usr/local/src/k8s/libs/k8s-operators-istio-operator-0.10.6') do
244 | it { should be_directory }
245 | end
246 | describe file('/usr/local/src/k8s/libs/k8s-operators-akka-cluster-operator-1.0.3') do
247 | it { should be_directory }
248 | end
249 | describe file('/usr/local/src/k8s/libs/k8s-operators-prometheus-operator-0.50.0') do
250 | it { should be_directory }
251 | end
252 | describe file('/usr/local/src/k8s/libs/k8s-operators-grafana-operator-3.10.3') do
253 | it { should be_directory }
254 | end
255 | end
256 |
--------------------------------------------------------------------------------
/test/integration/default/inspec.yml:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=yaml
3 | ---
4 | name: default
5 | title: kubernetes formula
6 | maintainer: SaltStack Formulas
7 | license: Apache-2.0
8 | summary: Verify that the kubernetes formula is setup and configured correctly
9 | supports:
10 | - platform-name: debian
11 | - platform-name: ubuntu
12 | - platform-name: centos
13 | - platform-name: fedora
14 | - platform-name: opensuse
15 | - platform-name: suse
16 | - platform-name: freebsd
17 | - platform-name: amazon
18 | - platform-name: arch
19 |
--------------------------------------------------------------------------------
/test/integration/redhat/README.md:
--------------------------------------------------------------------------------
1 | # InSpec Profile: `redhat`
2 |
3 | This shows the implementation of the `redhat` InSpec [profile](https://github.com/inspec/inspec/blob/master/docs/profiles.md).
4 |
5 | ## Verify a profile
6 |
7 | InSpec ships with built-in features to verify a profile structure.
8 |
9 | ```bash
10 | $ inspec check redhat
11 | Summary
12 | -------
13 | Location: redhat
14 | Profile: profile
15 | Controls: 4
16 | Timestamp: 2019-06-24T23:09:01+00:00
17 | Valid: true
18 |
19 | Errors
20 | ------
21 |
22 | Warnings
23 | --------
24 | ```
25 |
26 | ## Execute a profile
27 |
28 | To run all **supported** controls on a local machine use `inspec exec /path/to/profile`.
29 |
30 | ```bash
31 | $ inspec exec redhat
32 | ..
33 |
34 | Finished in 0.0025 seconds (files took 0.12449 seconds to load)
35 | 8 examples, 0 failures
36 | ```
37 |
38 | ## Execute a specific control from a profile
39 |
40 | To run one control from the profile use `inspec exec /path/to/profile --controls name`.
41 |
42 | ```bash
43 | $ inspec exec redhat --controls package
44 | .
45 |
46 | Finished in 0.0025 seconds (files took 0.12449 seconds to load)
47 | 1 examples, 0 failures
48 | ```
49 |
50 | See an [example control here](https://github.com/inspec/inspec/blob/master/examples/profile/controls/example.rb).
51 |
--------------------------------------------------------------------------------
/test/integration/redhat/inspec.yml:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=yaml
3 | ---
4 | name: redhat
5 | title: kubernetes formula
6 | maintainer: SaltStack Formulas
7 | license: Apache-2.0
8 | summary: Verify that the kubernetes formula is setup and configured correctly
9 | supports:
10 | - platform-name: centos
11 | - platform-name: fedora
12 |
--------------------------------------------------------------------------------
/test/integration/script/README.md:
--------------------------------------------------------------------------------
1 | # InSpec Profile: `default`
2 |
3 | This shows the implementation of the `default` InSpec [profile](https://github.com/inspec/inspec/blob/master/docs/profiles.md).
4 |
5 | ## Verify a profile
6 |
7 | InSpec ships with built-in features to verify a profile structure.
8 |
9 | ```bash
10 | $ inspec check default
11 | Summary
12 | -------
13 | Location: default
14 | Profile: profile
15 | Controls: 4
16 | Timestamp: 2019-06-24T23:09:01+00:00
17 | Valid: true
18 |
19 | Errors
20 | ------
21 |
22 | Warnings
23 | --------
24 | ```
25 |
26 | ## Execute a profile
27 |
28 | To run all **supported** controls on a local machine use `inspec exec /path/to/profile`.
29 |
30 | ```bash
31 | $ inspec exec default
32 | ..
33 |
34 | Finished in 0.0025 seconds (files took 0.12449 seconds to load)
35 | 8 examples, 0 failures
36 | ```
37 |
38 | ## Execute a specific control from a profile
39 |
40 | To run one control from the profile use `inspec exec /path/to/profile --controls name`.
41 |
42 | ```bash
43 | $ inspec exec default --controls package
44 | .
45 |
46 | Finished in 0.0025 seconds (files took 0.12449 seconds to load)
47 | 1 examples, 0 failures
48 | ```
49 |
50 | See an [example control here](https://github.com/inspec/inspec/blob/master/examples/profile/controls/example.rb).
51 |
--------------------------------------------------------------------------------
/test/integration/script/controls/default_spec.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | title 'kubernetes archives profile'
4 |
5 | control 'kubernetes archive' do
6 | impact 1.0
7 | title 'should be installed'
8 |
9 | describe file('/etc/systemd/system/k3s.service') do
10 | it { should exist }
11 | it { should_not be_directory }
12 | its('type') { should eq :file }
13 | end
14 | describe file('/usr/local/bin/k3s-killall.sh') do
15 | it { should exist }
16 | it { should_not be_directory }
17 | its('type') { should eq :file }
18 | end
19 | describe file('/etc/rancher/k3s/k3s.yaml') do
20 | it { should exist }
21 | it { should_not be_directory }
22 | its('type') { should eq :file }
23 | end
24 | describe file('/usr/local/bin/k3s') do
25 | it { should be_file }
26 | it { should_not be_directory }
27 | end
28 | describe file('/etc/rancher/k3s') do
29 | it { should be_directory }
30 | it { should_not be_file }
31 | end
32 | describe file('/var/lib/rancher/k3s/server/cred/admin.kubeconfig') do
33 | it { should exist }
34 | it { should_not be_directory }
35 | its('type') { should eq :file }
36 | end
37 | describe file('/var/lib/rancher/k3s/agent/k3scontroller.kubeconfig') do
38 | it { should exist }
39 | it { should_not be_directory }
40 | its('type') { should eq :file }
41 | end
42 | describe file('/var/lib/rancher/k3s/server/node-token') do
43 | it { should be_symlink }
44 | it { should be_file }
45 | it { should_not be_directory }
46 | end
47 | end
48 |
--------------------------------------------------------------------------------
/test/integration/script/inspec.yml:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=yaml
3 | ---
4 | name: script
5 | title: kubernetes formula
6 | maintainer: SaltStack Formulas
7 | license: Apache-2.0
8 | summary: Verify that the kubernetes formula is setup and configured correctly
9 | supports:
10 | - platform-name: debian
11 | - platform-name: ubuntu
12 | - platform-name: centos
13 | - platform-name: fedora
14 | - platform-name: opensuse
15 | - platform-name: suse
16 | - platform-name: freebsd
17 | - platform-name: amazon
18 | - platform-name: arch
19 |
--------------------------------------------------------------------------------
/test/salt/pillar/alma.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=yaml
3 | ---
4 | # This formula works with no-pillars but here are some example configurations.
5 |
6 | kubernetes:
7 | supported:
8 | - server
9 | - client
10 | - node
11 | - k3s
12 | - operator
13 | - operators
14 | - devlibs
15 | - devtools
16 | - sigs
17 | - crimgr
18 | sigs:
19 | wanted:
20 | - kind
21 | - krew
22 | - kubebuilder
23 | operators:
24 | wanted:
25 | - grafana-operator
26 | - prometheus-operator
27 | - akka-cluster-operator
28 | - istio-operator
29 | devlibs:
30 | wanted:
31 | - java
32 | - python
33 | - csharp
34 | - javascript
35 | - kopf
36 | - k8s
37 | - python
38 | - javascript
39 | operator:
40 | wanted: []
41 | sdk:
42 | wanted:
43 | - ansible-operator
44 | - helm-operator
45 | - operator-sdk
46 | devtools:
47 | wanted:
48 | - audit2rbac
49 | - cue
50 | - devspace
51 | - dive
52 | - istio
53 | - kubectx
54 | - kubens
55 | - kudo
56 | - linkerd2
57 | - minikube
58 | - octant
59 | - skaffold
60 | - stern
61 |
62 | linux:
63 | altpriority: 0
64 |
--------------------------------------------------------------------------------
/test/salt/pillar/default.sls:
--------------------------------------------------------------------------------
1 | ../../../pillar.example
--------------------------------------------------------------------------------
/test/salt/pillar/redhat.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=yaml
3 | ---
4 | # This formula works with no-pillars but here are some example configurations.
5 |
6 | kubernetes:
7 | supported:
8 | - server
9 | - client
10 | - node
11 | - k3s
12 | - operator
13 | - operators
14 | - devlibs
15 | - devtools
16 | - sigs
17 | - crimgr
18 | sigs:
19 | wanted:
20 | - kind
21 | - krew
22 | - kubebuilder
23 | operators:
24 | wanted:
25 | - grafana-operator
26 | - prometheus-operator
27 | - akka-cluster-operator
28 | - istio-operator
29 | devlibs:
30 | wanted:
31 | - java
32 | - python
33 | - csharp
34 | - javascript
35 | - kopf
36 | - k8s
37 | - python
38 | - javascript
39 | operator:
40 | wanted: []
41 | sdk:
42 | wanted:
43 | - ansible-operator
44 | - helm-operator
45 | - operator-sdk
46 | devtools:
47 | wanted:
48 | - audit2rbac
49 | - cue
50 | - devspace
51 | - dive
52 | - istio
53 | - kubectx
54 | - kubens
55 | - kudo
56 | - linkerd2
57 | - minikube
58 | - octant
59 | - skaffold
60 | - stern
61 |
62 | linux:
63 | altpriority: 0
64 |
--------------------------------------------------------------------------------
/test/salt/pillar/script.sls:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # vim: ft=yaml
3 | ---
4 | # This formula works with no-pillars but here are some example configurations.
5 |
6 | kubernetes:
7 | supported:
8 | - client
9 | - k3s
10 | operator:
11 | wanted:
12 | - sdk
13 | # test script installation
14 | k3s:
15 | pkg:
16 | use_upstream: script
17 |
18 | linux:
19 | altpriority: 1000
20 |
--------------------------------------------------------------------------------