├── .fixtures.yml
├── .gitattributes
├── .gitignore
├── .project
├── .rebuildbot.sh
├── .rspec
├── .rubocop.yml
├── .rubocop_todo.yml
├── .ruby-version
├── .travis.yml
├── CHANGELOG.md
├── CONTRIBUTING.md
├── CONTRIBUTORS
├── Gemfile
├── Guardfile
├── LICENSE
├── MAINTAINERS.md
├── NOTICE
├── README.md
├── Rakefile
├── appveyor.yml
├── files
├── 60-schedulers.rules
├── apple.conf
├── kbd_backlight.conf
├── laptop-mode.conf
├── xorg.conf.nouveau
└── xorg.conf.nvidia
├── locales
└── config.yaml
├── manifests
├── fstab_add_option.pp
├── fstab_remove_option.pp
├── fstab_replace_option.pp
├── init.pp
├── mac_keyboard.pp
├── macfanctld.pp
├── ssd.pp
├── touchpad.pp
├── videodriver.pp
├── webcam.pp
└── wireless.pp
├── metadata.json
├── spec
├── acceptance
│ ├── classes
│ │ ├── mac_keyboard_spec.rb
│ │ ├── macfanctld.rb
│ │ ├── ssd_spec.rb
│ │ ├── videodriver_spec.rb
│ │ ├── webcam_spec.rb
│ │ ├── wireless_spec.rb
│ │ └── xx_touchpad_spec.rb
│ └── nodesets
│ │ └── default.yml
├── acceptance_test_fact_overrides.yaml
├── classes
│ ├── coverage_spec.rb
│ ├── init_spec.rb
│ ├── mac_keyboard_spec.rb
│ ├── macfanctld_spec.rb
│ ├── ssd_spec.rb
│ ├── touchpad_spec.rb
│ ├── videodriver_spec.rb
│ ├── webcam_spec.rb
│ └── wireless_spec.rb
├── spec_helper.rb
├── spec_helper_acceptance.rb
└── spec_helper_local.rb
└── templates
└── 00-touchpad.conf.erb
/.fixtures.yml:
--------------------------------------------------------------------------------
1 | fixtures:
2 | repositories:
3 | stdlib:
4 | repo: "https://github.com/puppetlabs/puppetlabs-stdlib.git"
5 | ref: "4.12.0"
6 | archlinux_workstation:
7 | repo: "https://github.com/jantman/puppet-archlinux-workstation.git"
8 | firewall: "https://github.com/puppetlabs/puppetlabs-firewall.git"
9 | sysctl: "https://github.com/duritong/puppet-sysctl.git"
10 | inifile: "https://github.com/puppetlabs/puppetlabs-inifile.git"
11 | symlinks:
12 | archlinux_macbookretina: "#{source_dir}"
13 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | #This file is generated by ModuleSync, do not edit.
2 | *.rb eol=lf
3 | *.erb eol=lf
4 | *.pp eol=lf
5 | *.sh eol=lf
6 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # This file is generated by ModuleSync, do not edit.
2 | *.iml
3 | .*.sw[op]
4 | .DS_Store
5 | .bundle/
6 | .idea/
7 | .metadata
8 | .vagrant/
9 | .yardoc
10 | .yardwarns
11 | Gemfile.local
12 | Gemfile.lock
13 | bin/
14 | coverage/
15 | doc/
16 | junit/
17 | log/
18 | pkg/
19 | spec/fixtures/manifests/
20 | spec/fixtures/modules/
21 | tmp/
22 | vendor/
23 |
24 |
--------------------------------------------------------------------------------
/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | jantman-archlinux_macbookretina
4 |
5 |
6 |
7 |
8 |
9 | com.puppetlabs.geppetto.pp.dsl.ui.modulefileBuilder
10 |
11 |
12 |
13 |
14 | org.eclipse.xtext.ui.shared.xtextBuilder
15 |
16 |
17 |
18 |
19 |
20 | com.puppetlabs.geppetto.pp.dsl.ui.puppetNature
21 | org.eclipse.xtext.ui.shared.xtextNature
22 |
23 |
24 |
--------------------------------------------------------------------------------
/.rebuildbot.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash -ex
2 |
3 | set +x
4 | . ~/.rvm/scripts/rvm
5 | rvm use $(cat .ruby-version)
6 | rvm info
7 | which ruby
8 | ruby -v
9 | set -x
10 |
11 | bundle install --path vendor
12 | bundle exec rake spec_prep
13 | bundle exec rake beaker
14 |
--------------------------------------------------------------------------------
/.rspec:
--------------------------------------------------------------------------------
1 | --color
2 | --format documentation
3 |
--------------------------------------------------------------------------------
/.rubocop.yml:
--------------------------------------------------------------------------------
1 | ---
2 | require:
3 | - rubocop-rspec
4 | AllCops:
5 | TargetRubyVersion: '2.1'
6 | Include:
7 | - "./**/*.rb"
8 | Exclude:
9 | - bin/*
10 | - ".vendor/**/*"
11 | - Gemfile
12 | - Rakefile
13 | - pkg/**/*
14 | - spec/fixtures/**/*
15 | - vendor/**/*
16 | inherit_from: .rubocop_todo.yml
17 | Metrics/LineLength:
18 | Description: People have wide screens, use them.
19 | Max: 200
20 | RSpec/BeforeAfterAll:
21 | Description: Beware of using after(:all) as it may cause state to leak between tests.
22 | A necessary evil in acceptance testing.
23 | Exclude:
24 | - spec/acceptance/**/*.rb
25 | RSpec/HookArgument:
26 | Description: Prefer explicit :each argument, matching existing module's style
27 | EnforcedStyle: each
28 | Style/BlockDelimiters:
29 | Description: Prefer braces for chaining. Mostly an aesthetical choice. Better to
30 | be consistent then.
31 | EnforcedStyle: braces_for_chaining
32 | Style/ClassAndModuleChildren:
33 | Description: Compact style reduces the required amount of indentation.
34 | EnforcedStyle: compact
35 | Style/EmptyElse:
36 | Description: Enforce against empty else clauses, but allow `nil` for clarity.
37 | EnforcedStyle: empty
38 | Style/FormatString:
39 | Description: Following the main puppet project's style, prefer the % format format.
40 | EnforcedStyle: percent
41 | Style/FormatStringToken:
42 | Description: Following the main puppet project's style, prefer the simpler template
43 | tokens over annotated ones.
44 | EnforcedStyle: template
45 | Style/Lambda:
46 | Description: Prefer the keyword for easier discoverability.
47 | EnforcedStyle: literal
48 | Style/RegexpLiteral:
49 | Description: Community preference. See https://github.com/voxpupuli/modulesync_config/issues/168
50 | EnforcedStyle: percent_r
51 | Style/TernaryParentheses:
52 | Description: Checks for use of parentheses around ternary conditions. Enforce parentheses
53 | on complex expressions for better readability, but seriously consider breaking
54 | it up.
55 | EnforcedStyle: require_parentheses_when_complex
56 | Style/TrailingCommaInArguments:
57 | Description: Prefer always trailing comma on multiline argument lists. This makes
58 | diffs, and re-ordering nicer.
59 | EnforcedStyleForMultiline: comma
60 | Style/TrailingCommaInLiteral:
61 | Description: Prefer always trailing comma on multiline literals. This makes diffs,
62 | and re-ordering nicer.
63 | EnforcedStyleForMultiline: comma
64 | Style/SymbolArray:
65 | Description: Using percent style obscures symbolic intent of array's contents.
66 | EnforcedStyle: brackets
67 | Style/CollectionMethods:
68 | Enabled: true
69 | Style/MethodCalledOnDoEndBlock:
70 | Enabled: true
71 | Style/StringMethods:
72 | Enabled: true
73 | Metrics/AbcSize:
74 | Enabled: false
75 | Metrics/BlockLength:
76 | Enabled: false
77 | Metrics/ClassLength:
78 | Enabled: false
79 | Metrics/CyclomaticComplexity:
80 | Enabled: false
81 | Metrics/MethodLength:
82 | Enabled: false
83 | Metrics/ModuleLength:
84 | Enabled: false
85 | Metrics/ParameterLists:
86 | Enabled: false
87 | Metrics/PerceivedComplexity:
88 | Enabled: false
89 | RSpec/DescribeClass:
90 | Enabled: false
91 | RSpec/MessageExpectation:
92 | Enabled: false
93 | Style/AsciiComments:
94 | Enabled: false
95 | Style/IfUnlessModifier:
96 | Enabled: false
97 | Style/SymbolProc:
98 | Enabled: false
99 |
--------------------------------------------------------------------------------
/.rubocop_todo.yml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jantman/puppet-archlinux-macbookretina/4aeba4d7614d55e446104e42007c361359aa366d/.rubocop_todo.yml
--------------------------------------------------------------------------------
/.ruby-version:
--------------------------------------------------------------------------------
1 | ruby-2.2.5
2 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | #This file is generated by ModuleSync, do not edit.
2 | ---
3 | sudo: false
4 | language: ruby
5 | cache: bundler
6 | script: "bundle exec rake release_checks_nonparallel"
7 | #Inserting below due to the following issue: https://github.com/travis-ci/travis-ci/issues/3531#issuecomment-88311203
8 | before_install:
9 | - gem update bundler
10 | matrix:
11 | fast_finish: true
12 | include:
13 | - rvm: 2.3.1
14 | dist: trusty
15 | env: PUPPET_INSTALL_TYPE=foss BEAKER_debug=true BEAKER_set=default
16 | script: bundle exec rake beaker
17 | services: docker
18 | sudo: required
19 | - rvm: 2.4.1
20 | bundler_args: --without system_tests
21 | env: PUPPET_GEM_VERSION="~> 5.0"
22 | script: ["bundle exec rake release_checks_nonparallel", "bundle exec rake clean", "bundle exec rake build", "bundle exec rake docs"]
23 | - rvm: 2.1.9
24 | bundler_args: --without system_tests
25 | env: PUPPET_GEM_VERSION="~> 4.0"
26 | deploy:
27 | - provider: pages
28 | skip_cleanup: true
29 | github_token:
30 | secure: "XfxAA80XBKZV0eOL2M3FLw5IiEcgt8knwtHoYh6yYax1ZZiVbb6yIjN5LSlJsL7bQ7jxW7Q7XcZXygOI15JKTqM6kJ6N0Z+QPxljeqwI3CedDKHZCBa1lwfuSqHrAuek9q3tsqPBJGoe86/+fp9TnDogGX7q+Ie1Ct0k5wiBeFk="
31 | local_dir: doc
32 | on:
33 | repo: jantman/puppet-archlinux-macbookretina
34 | rvm: 2.4.1
35 | # all_branches is required to use tags
36 | all_branches: true
37 | tags: true
38 | - provider: puppetforge
39 | user: jantman
40 | password:
41 | secure: "iGt519UxAls/ys0tPj3G6vDA8dvQfaJIZ1L2AaB4HkDGozPhEU5eas0LVnaV1vt5t05IqQRwTysY2UenrxQ9/NkAEB3M2xXdJJc69uUEuEnJKe7Ex/SklCeqGprxiylw7DKbSfUyVfF/IlssHPIThX9RW2UpQHVunRbK01J0F0w="
42 | on:
43 | repo: jantman/puppet-archlinux-macbookretina
44 | rvm: 2.4.1
45 | # all_branches is required to use tags
46 | all_branches: true
47 | tags: true
48 | notifications:
49 | email:
50 | on_success: change
51 | on_failure: change
52 | branches:
53 | except:
54 | - "/^noci-.*$/"
55 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | All notable changes to this project will be documented in this file.
4 |
5 | The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
6 | and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
7 |
8 | [comment]: # IMPORTANT: Remember to update the links at the bottom of the file!
9 |
10 | ## [0.3.1] Released 2019-03-19
11 |
12 | This project is now officially unsupported/abandoned and looking for a new maintainer. Please see [Issue 16](https://github.com/jantman/puppet-archlinux-macbookretina/issues/16) for details and to comment.
13 |
14 | ## [0.3.0] Released 2018-02-03
15 |
16 | This release makes major changes to the module code style, testing and deployment. It does not make any functional changes to what the module does or how it works.
17 |
18 | - Switch to new-style typed parameters.
19 | - Modernize module layout and testing.
20 | - Update supported and tested Puppet versions to 4 and 5.
21 | - Pin puppetlabs-stdlib dependency to 4.12.0, as this module still uses the deprecated ``validate_`` functions (and its archlinux_workstation dependency requires <= 4.12.0).
22 | - Use puppet-strings for documentation
23 | - Automate deployment through TravisCI
24 | - Minor README and CONTRIBUTING documentation updates.
25 | - Add automated ``github_release`` Rake task.
26 | - Bump puppet-blacksmith gem version and configure for signed tags.
27 | - Reformat changelog
28 | - Add ``.sync.yml`` for my [modulesync_configs](https://github.com/jantman/modulesync_configs)
29 | - Update ``.travis.yml``, ``Gemfile`` and some documentation via modulesync.
30 | - Fix ``metadata.json`` casing of supported operatingsystem name.
31 |
32 | ## [0.2.2] Released 2017-07-09
33 |
34 | - Update for AUR package changes: bcwc-pcie-dkms -> bcwc-pcie-git and bcwc-firmware -> facetimehd-firmware
35 |
36 | ## [0.2.1] Released 2017-01-08
37 |
38 | - updated README with note that bluetooth now works
39 | - many changes to testing (TravisCI, spec, beaker acceptance) and use new versions of dependencies (thanks to petems)
40 | - fix ordering bug in archlinux_macbookretina::touchpad (thanks to petems)
41 |
42 | ## [0.2.0] Released 2016-10-25
43 |
44 | - ensure xf86-input-mtrack-git is absent, in favor of xf86-input-synaptics
45 | - update README.md with updated statuses as of 2016-10-25 and 4.8.4-1 kernel
46 | - touchpad works, but some 3-finger-tap issues
47 | - built-in ``brcmfmac`` WiFi driver works for both 2.4GHz and 5GHz
48 | - backlight adjustment and other hotkeys work with keyboard function keys, using kernel built-in drivers
49 | - webcam works using AUR reverse-engineered driver
50 | - add ``archlinux_macbookretina::webcam`` for reverse-engineered driver
51 |
52 | ## [0.1.0] Released 2015-09-16
53 |
54 | - complete rewrite to be more reusable, standalone module, and targeted at puppet4
55 |
56 | ## 0.0.1 Released 2014-03-15
57 |
58 | - initial module creation
59 |
60 | [0.3.0]: https://github.com/jantman/puppet-archlinux-macbookretina/compare/0.2.2...0.3.0
61 | [0.2.2]: https://github.com/jantman/puppet-archlinux-macbookretina/compare/0.2.1...0.2.2
62 | [0.2.1]: https://github.com/jantman/puppet-archlinux-macbookretina/compare/0.2.0...0.2.1
63 | [0.2.0]: https://github.com/jantman/puppet-archlinux-macbookretina/compare/0.1.0...0.2.0
64 | [0.1.0]: https://github.com/jantman/puppet-archlinux-macbookretina/releases/tag/0.1.0
65 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to Puppet modules
2 |
3 | So you want to contribute to a Puppet module: Great! Below are some instructions to get you started doing
4 | that very thing while setting expectations around code quality as well as a few tips for making the
5 | process as easy as possible.
6 |
7 | ### Table of Contents
8 |
9 | 1. [Getting Started](#getting-started)
10 | 1. [Commit Checklist](#commit-checklist)
11 | 1. [Submission](#submission)
12 | 1. [More about commits](#more-about-commits)
13 | 1. [Testing](#testing)
14 | - [Running Tests](#running-tests)
15 | - [Writing Tests](#writing-tests)
16 | 1. [Get Help](#get-help)
17 | 1. [Release Process](#release-process)
18 |
19 | ## Getting Started
20 |
21 | - Fork the module repository on GitHub and clone to your workspace
22 |
23 | - Make your changes!
24 |
25 | ## Commit Checklist
26 |
27 | ### The Basics
28 |
29 | - [x] my commit is a single logical unit of work
30 |
31 | - [x] I have checked for unnecessary whitespace with "git diff --check"
32 |
33 | - [x] my commit does not include commented out code or unneeded files
34 |
35 | ### The Content
36 |
37 | - [x] my commit includes tests for the bug I fixed or feature I added
38 |
39 | - [x] my commit includes appropriate documentation changes if it is introducing a new feature or changing existing functionality
40 |
41 | - [x] my code passes existing test suites
42 |
43 | ### The Commit Message
44 |
45 | - [x] the first line of my commit message includes:
46 |
47 | - [x] an issue number (if applicable), e.g. "(MODULES-xxxx) This is the first line"
48 |
49 | - [x] a short description (50 characters is the soft limit, excluding ticket number(s))
50 |
51 | - [x] the body of my commit message:
52 |
53 | - [x] is meaningful
54 |
55 | - [x] uses the imperative, present tense: "change", not "changed" or "changes"
56 |
57 | - [x] includes motivation for the change, and contrasts its implementation with the previous behavior
58 |
59 | ## Submission
60 |
61 | ### Push and PR
62 |
63 | - Push your changes to your fork
64 |
65 | - [Open a Pull Request](https://help.github.com/articles/creating-a-pull-request-from-a-fork/) against the repository in the puppetlabs organization
66 |
67 | ## More about commits
68 |
69 | 1. Make separate commits for logically separate changes.
70 |
71 | Please break your commits down into logically consistent units
72 | which include new or changed tests relevant to the rest of the
73 | change. The goal of doing this is to make the diff easier to
74 | read for whoever is reviewing your code. In general, the easier
75 | your diff is to read, the more likely someone will be happy to
76 | review it and get it into the code base.
77 |
78 | If you are going to refactor a piece of code, please do so as a
79 | separate commit from your feature or bug fix changes.
80 |
81 | We also really appreciate changes that include tests to make
82 | sure the bug is not re-introduced, and that the feature is not
83 | accidentally broken.
84 |
85 | Describe the technical detail of the change(s). If your
86 | description starts to get too long, that is a good sign that you
87 | probably need to split up your commit into more finely grained
88 | pieces.
89 |
90 | Commits which plainly describe the things which help
91 | reviewers check the patch and future developers understand the
92 | code are much more likely to be merged in with a minimum of
93 | bike-shedding or requested changes. Ideally, the commit message
94 | would include information, and be in a form suitable for
95 | inclusion in the release notes for the version of Puppet that
96 | includes them.
97 |
98 | Please also check that you are not introducing any trailing
99 | whitespace or other "whitespace errors". You can do this by
100 | running "git diff --check" on your changes before you commit.
101 |
102 | 2. Sending your patches
103 |
104 | To submit your changes via a GitHub pull request, we _highly_
105 | recommend that you have them on a topic branch, instead of
106 | directly on "master".
107 | It makes things much easier to keep track of, especially if
108 | you decide to work on another thing before your first change
109 | is merged in.
110 |
111 | GitHub has some pretty good
112 | [general documentation](http://help.github.com/) on using
113 | their site. They also have documentation on
114 | [creating pull requests](https://help.github.com/articles/creating-a-pull-request-from-a-fork/).
115 |
116 | In general, after pushing your topic branch up to your
117 | repository on GitHub, you can switch to the branch in the
118 | GitHub UI and click "Pull Request" towards the top of the page
119 | in order to open a pull request.
120 |
121 | 3. Update the related JIRA issue.
122 |
123 | If there is a JIRA issue associated with the change you
124 | submitted, then you should update the ticket to include the
125 | location of your branch, along with any other commentary you
126 | may wish to make.
127 |
128 | # Testing
129 |
130 | ## Getting Started
131 |
132 | Our Puppet modules provide [`Gemfile`](./Gemfile)s, which can tell a Ruby package manager such as [bundler](http://bundler.io/) what Ruby packages,
133 | or Gems, are required to build, develop, and test this software.
134 |
135 | Please make sure you have [bundler installed](http://bundler.io/#getting-started) on your system, and then use it to
136 | install all dependencies needed for this project in the project root by running
137 |
138 | ```shell
139 | % bundle install --path .bundle/gems
140 | Fetching gem metadata from https://rubygems.org/........
141 | Fetching gem metadata from https://rubygems.org/..
142 | Using rake (10.1.0)
143 | Using builder (3.2.2)
144 | -- 8><-- many more --><8 --
145 | Using rspec-system-puppet (2.2.0)
146 | Using serverspec (0.6.3)
147 | Using rspec-system-serverspec (1.0.0)
148 | Using bundler (1.3.5)
149 | Your bundle is complete!
150 | Use `bundle show [gemname]` to see where a bundled gem is installed.
151 | ```
152 |
153 | NOTE: some systems may require you to run this command with sudo.
154 |
155 | If you already have those gems installed, make sure they are up-to-date:
156 |
157 | ```shell
158 | % bundle update
159 | ```
160 |
161 | ## Running Tests
162 |
163 | With all dependencies in place and up-to-date, run the tests:
164 |
165 | ### Unit Tests
166 |
167 | ```shell
168 | % bundle exec rake spec
169 | ```
170 |
171 | This executes all the [rspec tests](http://rspec-puppet.com/) in the directories defined [here](https://github.com/puppetlabs/puppetlabs_spec_helper/blob/699d9fbca1d2489bff1736bb254bb7b7edb32c74/lib/puppetlabs_spec_helper/rake_tasks.rb#L17) and so on.
172 | rspec tests may have the same kind of dependencies as the module they are testing. Although the module defines these dependencies in its [metadata.json](./metadata.json),
173 | rspec tests define them in [.fixtures.yml](./fixtures.yml).
174 |
175 | Before submitting a pull request, you should run the full pre-release check Rake task:
176 |
177 | ```shell
178 | % bundle exec rake release_checks
179 | ```
180 |
181 | ### Acceptance Tests
182 |
183 | Some Puppet modules also come with acceptance tests, which use [beaker][]. These tests spin up a virtual machine under
184 | [VirtualBox](https://www.virtualbox.org/), controlled with [Vagrant](http://www.vagrantup.com/), to simulate scripted test
185 | scenarios. In order to run these, you need both Virtualbox and Vagrant installed on your system.
186 |
187 | Run the tests by issuing the following command
188 |
189 | ```shell
190 | % bundle exec rake spec_clean
191 | % bundle exec rake beaker
192 | ```
193 |
194 | This will now download a pre-fabricated image configured in the [default node-set](./spec/acceptance/nodesets/default.yml),
195 | install Puppet, copy this module, and install its dependencies per [spec/spec_helper_acceptance.rb](./spec/spec_helper_acceptance.rb)
196 | and then run all the tests under [spec/acceptance](./spec/acceptance).
197 |
198 | ## Writing Tests
199 |
200 | ### Unit Tests
201 |
202 | When writing unit tests for Puppet, [rspec-puppet][] is your best friend. It provides tons of helper methods for testing your manifests against a
203 | catalog (e.g. contain_file, contain_package, with_params, etc). It would be ridiculous to try and top rspec-puppet's [documentation][rspec-puppet_docs]
204 | but here's a tiny sample:
205 |
206 | Sample manifest:
207 |
208 | ```puppet
209 | file { "a test file":
210 | ensure => present,
211 | path => "/etc/sample",
212 | }
213 | ```
214 |
215 | Sample test:
216 |
217 | ```ruby
218 | it 'does a thing' do
219 | expect(subject).to contain_file("a test file").with({:path => "/etc/sample"})
220 | end
221 | ```
222 |
223 | ### Acceptance Tests
224 |
225 | Writing acceptance tests for Puppet involves [beaker][] and its cousin [beaker-rspec][]. A common pattern for acceptance tests is to create a test manifest, apply it
226 | twice to check for idempotency or errors, then run expectations.
227 |
228 | ```ruby
229 | it 'does an end-to-end thing' do
230 | pp = <<-EOF
231 | file { 'a test file':
232 | ensure => present,
233 | path => "/etc/sample",
234 | content => "test string",
235 | }
236 | EOF
237 |
238 | apply_manifest(pp, :catch_failures => true)
239 | apply_manifest(pp, :catch_changes => true)
240 |
241 | end
242 |
243 | describe file("/etc/sample") do
244 | it { is_expected.to contain "test string" }
245 | end
246 |
247 | ```
248 |
249 | ### If you have commit access to the repository
250 |
251 | Even if you have commit access to the repository, you still need to go through the process above, and have someone else review and merge
252 | in your changes. The rule is that **all changes must be reviewed by a project developer that did not write the code to ensure that
253 | all changes go through a code review process.**
254 |
255 | The record of someone performing the merge is the record that they performed the code review. Again, this should be someone other than the author of the topic branch.
256 |
257 | # Get Help
258 |
259 | ### On the web
260 |
261 | * [Puppet help messageboard](http://puppet.com/community/get-help)
262 | * [Writing tests](https://docs.puppet.com/guides/module_guides/bgtm.html#step-three-module-testing)
263 | * [General GitHub documentation](http://help.github.com/)
264 | * [GitHub pull request documentation](http://help.github.com/send-pull-requests/)
265 |
266 | # Release Process
267 |
268 | 1. Ensure all changes were merged to master via PRs.
269 | 2. Ensure a [CHANGELOG.md](CHANGELOG.md) entry exists for every change.
270 | 3. Use ``bundle exec rake module:bump`` to bump the module version.
271 | 4. Update ``CHANGELOG.md`` with the new version, and ensure a link exists for the diff from the last release.
272 | 5. Commit those changes (``CHANGELOG.md`` and ``metadata.json``) and push. Wait for the TravisCI build to pass.
273 | 6. Use ``bundle exec rake github_release`` to tag the version, push that tag, and create a GitHub Release.
274 | 7. TravisCI will build the module and push to the forge, and build docs and push them to github pages.
275 |
276 | [rspec-puppet]: http://rspec-puppet.com/
277 | [rspec-puppet_docs]: http://rspec-puppet.com/documentation/
278 | [beaker]: https://github.com/puppetlabs/beaker
279 | [beaker-rspec]: https://github.com/puppetlabs/beaker-rspec
280 |
--------------------------------------------------------------------------------
/CONTRIBUTORS:
--------------------------------------------------------------------------------
1 | jantman
2 |
--------------------------------------------------------------------------------
/Gemfile:
--------------------------------------------------------------------------------
1 | #This file is generated by ModuleSync, do not edit.
2 |
3 | source ENV['GEM_SOURCE'] || "https://rubygems.org"
4 |
5 | # Determines what type of gem is requested based on place_or_version.
6 | def gem_type(place_or_version)
7 | if place_or_version =~ /^git:/
8 | :git
9 | elsif place_or_version =~ /^file:/
10 | :file
11 | else
12 | :gem
13 | end
14 | end
15 |
16 | # Find a location or specific version for a gem. place_or_version can be a
17 | # version, which is most often used. It can also be git, which is specified as
18 | # `git://somewhere.git#branch`. You can also use a file source location, which
19 | # is specified as `file://some/location/on/disk`.
20 | def location_for(place_or_version, fake_version = nil)
21 | if place_or_version =~ /^(git[:@][^#]*)#(.*)/
22 | [fake_version, { :git => $1, :branch => $2, :require => false }].compact
23 | elsif place_or_version =~ /^file:\/\/(.*)/
24 | ['>= 0', { :path => File.expand_path($1), :require => false }]
25 | else
26 | [place_or_version, { :require => false }]
27 | end
28 | end
29 |
30 | # Used for gem conditionals
31 | ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
32 | minor_version = "#{ruby_version_segments[0]}.#{ruby_version_segments[1]}"
33 |
34 | # The following gems are not included by default as they require DevKit on Windows.
35 | # You should probably include them in a Gemfile.local or a ~/.gemfile
36 | #gem 'pry' #this may already be included in the gemfile
37 | #gem 'pry-stack_explorer', :require => false
38 | #if RUBY_VERSION =~ /^2/
39 | # gem 'pry-byebug'
40 | #else
41 | # gem 'pry-debugger'
42 | #end
43 |
44 | group :development do
45 | gem "puppet-module-posix-default-r#{minor_version}", :require => false, :platforms => "ruby"
46 | gem "puppet-module-win-default-r#{minor_version}", :require => false, :platforms => ["mswin", "mingw", "x64_mingw"]
47 | gem "puppet-module-posix-dev-r#{minor_version}", :require => false, :platforms => "ruby"
48 | gem "puppet-module-win-dev-r#{minor_version}", '0.0.7', :require => false, :platforms => ["mswin", "mingw", "x64_mingw"]
49 | gem "json_pure", '<= 2.0.1', :require => false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
50 | gem "fast_gettext", '1.1.0', :require => false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0')
51 | gem "fast_gettext", :require => false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
52 | gem "puppet-strings", :require => false
53 | end
54 |
55 | group :system_tests do
56 | gem "beaker-docker", '>= 0.3.0', :require => false
57 | gem "puppet-module-posix-system-r#{minor_version}", :require => false, :platforms => "ruby"
58 | gem "puppet-module-win-system-r#{minor_version}", :require => false, :platforms => ["mswin", "mingw", "x64_mingw"]
59 | gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '>= 3')
60 | gem "beaker-pe", :require => false
61 | gem "beaker-rspec", *location_for(ENV['BEAKER_RSPEC_VERSION'])
62 | gem "beaker-hostgenerator", *location_for(ENV['BEAKER_HOSTGENERATOR_VERSION'])
63 | gem "beaker-abs", *location_for(ENV['BEAKER_ABS_VERSION'] || '~> 0.1')
64 | gem "puppet-blacksmith", '>= 4.1.1', :require => false
65 | gem "vandamme", :require => false
66 | gem "octokit", '~> 4.0', :require => false
67 | end
68 |
69 | gem 'puppet', *location_for(ENV['PUPPET_GEM_VERSION'])
70 |
71 | # Only explicitly specify Facter/Hiera if a version has been specified.
72 | # Otherwise it can lead to strange bundler behavior. If you are seeing weird
73 | # gem resolution behavior, try setting `DEBUG_RESOLVER` environment variable
74 | # to `1` and then run bundle install.
75 | gem 'facter', *location_for(ENV['FACTER_GEM_VERSION']) if ENV['FACTER_GEM_VERSION']
76 | gem 'hiera', *location_for(ENV['HIERA_GEM_VERSION']) if ENV['HIERA_GEM_VERSION']
77 |
78 | # Evaluate Gemfile.local if it exists
79 | if File.exists? "#{__FILE__}.local"
80 | eval(File.read("#{__FILE__}.local"), binding)
81 | end
82 |
83 | # Evaluate ~/.gemfile if it exists
84 | if File.exists?(File.join(Dir.home, '.gemfile'))
85 | eval(File.read(File.join(Dir.home, '.gemfile')), binding)
86 | end
87 |
88 | # vim:ft=ruby
89 |
--------------------------------------------------------------------------------
/Guardfile:
--------------------------------------------------------------------------------
1 | notification :off
2 |
3 | guard 'rake', :task => 'test' do
4 | watch(%r{^manifests\/(.+)\.pp$})
5 | end
6 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/MAINTAINERS.md:
--------------------------------------------------------------------------------
1 | ## Maintenance
2 |
3 | Maintainers:
4 | - Jason Antman `jason |at| jasonantman |dot| com`
5 |
6 | Tickets: https://github.com/jantman/puppet-archlinux-macbookretina/issues
7 |
--------------------------------------------------------------------------------
/NOTICE:
--------------------------------------------------------------------------------
1 | Puppet Module - jantman-archlinux_macbookretina
2 |
3 | Copyright 2018 Jason Antman
4 |
5 | Licensed under the GNU GPL v3;
6 | you may not use this file except in compliance with the License.
7 | You may obtain a copy of the License at
8 |
9 | https://www.gnu.org/licenses/gpl-3.0.en.html
10 |
11 | Unless required by applicable law or agreed to in writing, software
12 | distributed under the License is distributed on an "AS IS" BASIS,
13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | See the License for the specific language governing permissions and
15 | limitations under the License.
16 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## UNSUPPORTED / ABANDONED PROJECT - MAINTAINER WANTED
2 |
3 | As of March 2019, I no longer have access to any MacBook Pro hardware. As such, this module is now officially unsupported and abandoned. A new maintainer is wanted, if anyone would like to adopt it. Please see [Issue 16](https://github.com/jantman/puppet-archlinux-macbookretina/issues/16) for details and to comment.
4 |
5 | #### Table of Contents
6 |
7 | 1. [Overview](#overview)
8 | 2. [Requirements](#requirements)
9 | 3. [Hardware Support Status](#hardware-support-status)
10 | 4. [Reference - An under-the-hood peek at what the module is doing and how](#reference)
11 | 5. [Limitations - OS compatibility, etc.](#limitations)
12 | 6. [Development - Guide for contributing to the module](#development)
13 | 7. [Other References - Information on Arch Linux](#other-references)
14 |
15 | ## Overview
16 |
17 | [](https://travis-ci.org/jantman/puppet-archlinux-macbookretina.svg)
18 | [](https://forge.puppet.com/jantman/archlinux_macbookretina/)
19 | [](https://www.repostatus.org/#unsupported)
20 |
21 | Puppet module and accompanying documentation to install/setup Arch linux on a MacBook Pro Retina using Puppet (version 4 or 5).
22 |
23 | This is the puppet module I use to manage my shiny new MacBook Pro Retina (mine is a ``MacBookPro11,4``).
24 |
25 | * __Generated Documentation:__ http://jantman.github.io/puppet-archlinux-macbookretina/
26 |
27 | __Important Notice:__ It is _highly_ recommended that you only run this module on a brand new system;
28 | it makes some opinionated choices that may cause problems on existing systems.
29 |
30 | ## Requirements
31 |
32 | * A MacBook Pro Retina (currently tested with Mid-2015 "11,4" model) with a __brand new install__ of Arch Linux
33 | * Whatever version of Puppet ships with Arch Linux
34 | * A minimal install, ideally following the instructions in my [workstation-bootstrap](https://github.com/jantman/workstation-bootstrap) repository.
35 | * This module is only tested alongside my [archlinux_workstation](https://github.com/jantman/puppet-archlinux-workstation) module.
36 | * A pacman repo providing AUR packages: [macfanctld](https://aur.archlinux.org/packages/macfanctld), [bcwc-pcie-dkms](https://aur.archlinux.org/packages/bcwc-pcie-dkms/) and [bcwc-pcie-firmware](https://aur.archlinux.org/packages/bcwc-pcie-firmware/); you can use [jantman/archlinux_workstation archlinux_workstation::repos::jantman](https://github.com/jantman/puppet-archlinux-workstation/blob/master/manifests/repos/jantman.pp) for that.
37 |
38 | ## Hardware Support Status
39 |
40 | ### Mid-2015 MacBookPro11,4 as of 2018-02-02
41 |
42 | #### Working
43 |
44 | Or mostly-working:
45 |
46 | * __Touchpad__ using Kernel 4.2+ and [xf86-input-synaptics](https://www.archlinux.org/packages/?name=xf86-input-synaptics); works for tap-to-click, drag, two-finger scroll, and 2- or 3-finger taps (sometimes) for different mouse buttons.
47 | * __Networking__ on MacBookPro 11,4
48 | * USB ethernet adapter A1277 works out-of-the-box
49 | * BCM43602 AirPort Extreme (14e4:43ba) works with kernel built-in [brcmfmac](https://wireless.wiki.kernel.org/en/users/drivers/brcm80211) driver, autodetected, both 2.4GHz and 5GHz.
50 | * __Sound__ - Works. Under KDE/Phonon, needed to unmute/enable the "Built-in Audio Analog Stereo" (detected "Built-in Audio Digital Stereo (HDMI)" as default).
51 | * __Video__ - video works with the proprietary nvidia driver, the default in this module.
52 | * __External Displays__ - Tested OK using both direct HDMI and Thunderbolt to HDMI (1 or 2 external monitors); works seamlessly.
53 | * __Display/Desktop Scaling__ - This can be fixed within KDE:
54 | * System Settings -> Fonts: check off "Force fonts DIP" and set to 144
55 | * System Settings -> Icons -> "Advanced" tab: set them all to 48
56 | * Click the menu button on the far right edge of the Panel, then drag the "Height" box up until the scale/size looks good
57 | * __Screen Backlight Adjustment__ - works using ``/sys/class/backlight/acpi_video0/brightness``, the sliders on 'KDE5 System Settings -> Energy Saving' or the keyboard function keys.
58 | * __Hibernate / Suspend to Disk__ - doesn't wake up without long hold of power button & then turn back on. Session resumes once that's done.
59 | * __SD Card Reader__ - Working out of the box.
60 | * __Fans__ - [macfanctld (AUR)](https://aur.archlinux.org/packages/macfanctld)
61 | * __Webcam__ - This works properly in Linux using the [bcwc-pcie-dkms](https://aur.archlinux.org/packages/bcwc-pcie-dkms/) and [bcwc-pcie-firmware](https://aur.archlinux.org/packages/bcwc-pcie-firmware/) AUR packages.
62 | * __Bluetooth__ - Per [wiki](https://wiki.archlinux.org/index.php/MacBook#Bluetooth_2), fully supported as of kernel 4.4.0. Works with my bluetooth mouse.
63 |
64 | #### Broken
65 |
66 | * __Suspend to RAM__ - _(haven't tested in many months; I never use this)_ doesn't wake up; long hold of power button & then turn back on gives a fresh boot.
67 | * __Lid Close__ - suspends to ram and doesn't wake up, but this could be a configuration issue. I never use this functionality.
68 |
69 | #### Untested / To Do
70 |
71 | * __Partially-complete__ - __SSD optimizations__ via sysctl settings, mount /dev/sda* noatime and discard (TRIM), use deadline scheduler on non-rotational disks
72 | * __Power Saving__ - https://wiki.archlinux.org/index.php/MacBookPro11,x#Powersave and https://wiki.archlinux.org/index.php/Laptop_Mode_Tools
73 | * [Laptop Mode Tools - ArchWiki](https://wiki.archlinux.org/index.php/Laptop_Mode_Tools) and/or [TLP - ArchWiki](https://wiki.archlinux.org/index.php/TLP) *(started looking into this, very involved configuration and I don't really need it right now)*
74 | * I'm left handed. Use udev/xorg to reverse buttons on USB mice but keep trackpad the same. See https://wiki.archlinux.org/index.php/All_Mouse_Buttons_Working http://www.smop.co.uk/blog/index.php/2010/02/15/udev-rules-for-logitech-g7-mouse/ or might be able to do this with udev triggering "xinput set-button-map"
75 | * the stuff in [Maximizing Performance - ArchWiki](https://wiki.archlinux.org/index.php/Maximizing_Performance)
76 | * implement the stuff in [Enhancing Arch Linux Stability - ArchWiki](https://wiki.archlinux.org/index.php/Enhancing_Arch_Linux_Stability)
77 | * SMART/other SSD health check, with warnings if problems are found
78 | * look into replacing macfanctld with mbpfan / fan-control-daemon are two options that are less abrupt
79 |
80 | ## Reference
81 |
82 | For full automatically-generated documentation see: [http://jantman.github.io/puppet-archlinux-workstation/](http://jantman.github.io/puppet-archlinux-workstation/)
83 |
84 | ## Limitations
85 |
86 | This module is only usable with Arch Linux on a MacBook Pro Retina.
87 |
88 | It assumes that you have a relatively vanilla base install of Arch, such as the one I document in my [workstation-bootstrap module](https://github.com/jantman/workstation-bootstrap#arch-linux),
89 | pretty much the same as the [Arch Linux Installation Guide](https://wiki.archlinux.org/index.php/Installation_guide) documents.
90 |
91 | ## Development
92 |
93 | See [CONTRIBUTING.md](CONTRIBUTING.md) for information about development and contributing.
94 |
95 | ## Other References
96 |
97 | * First, many thanks to [eli meister](https://twitter.com/elitmeister) for being the office linux-on-MBP retina guinea pig
98 | * [MacBookPro Retina - ArchWiki](https://wiki.archlinux.org/index.php/MacBookPro_Retina)
99 | * [MacBook - ArchWiki](https://wiki.archlinux.org/index.php/MacBook)
100 | * [Installation Guide - ArchWiki](https://wiki.archlinux.org/index.php/Installation_Guide)
101 | * [Beginners' Guide - ArchWiki](https://wiki.archlinux.org/index.php/Beginners%27_Guide)
102 | * [Solid State Drives - ArchWiki](https://wiki.archlinux.org/index.php/Solid_State_Drives)
103 | * [Laptop - ArchWiki](https://wiki.archlinux.org/index.php/Laptop)
104 | * [Enhancing Arch Linux Stability - ArchWiki](https://wiki.archlinux.org/index.php/Enhancing_Arch_Linux_Stability)
105 | * [Arch Linux System Maintenance - ArchWiki](https://wiki.archlinux.org/index.php/Arch_Linux_System_Maintenance)
106 |
--------------------------------------------------------------------------------
/Rakefile:
--------------------------------------------------------------------------------
1 | require 'puppetlabs_spec_helper/rake_tasks'
2 | require 'puppet-lint/tasks/puppet-lint'
3 | require 'puppet_blacksmith/rake_tasks' if Bundler.rubygems.find_name('puppet-blacksmith').any?
4 | require 'puppet-strings' if Bundler.rubygems.find_name('puppet-strings').any?
5 | require 'vandamme' if Bundler.rubygems.find_name('vandamme').any?
6 | require 'octokit' if Bundler.rubygems.find_name('octokit').any?
7 | require 'json'
8 |
9 | PuppetLint.configuration.fail_on_warnings = true
10 | PuppetLint.configuration.send('relative')
11 |
12 | desc 'Generate pooler nodesets'
13 | task :gen_nodeset do
14 | require 'beaker-hostgenerator'
15 | require 'securerandom'
16 | require 'fileutils'
17 |
18 | agent_target = ENV['TEST_TARGET']
19 | if ! agent_target
20 | STDERR.puts 'TEST_TARGET environment variable is not set'
21 | STDERR.puts 'setting to default value of "redhat-64default."'
22 | agent_target = 'redhat-64default.'
23 | end
24 |
25 | master_target = ENV['MASTER_TEST_TARGET']
26 | if ! master_target
27 | STDERR.puts 'MASTER_TEST_TARGET environment variable is not set'
28 | STDERR.puts 'setting to default value of "redhat7-64mdcl"'
29 | master_target = 'redhat7-64mdcl'
30 | end
31 |
32 | targets = "#{master_target}-#{agent_target}"
33 | cli = BeakerHostGenerator::CLI.new([targets])
34 | nodeset_dir = "tmp/nodesets"
35 | nodeset = "#{nodeset_dir}/#{targets}-#{SecureRandom.uuid}.yaml"
36 | FileUtils.mkdir_p(nodeset_dir)
37 | File.open(nodeset, 'w') do |fh|
38 | fh.print(cli.execute)
39 | end
40 | puts nodeset
41 | end
42 |
43 | desc "NON-PARALLEL version of release_checks"
44 | task :release_checks_nonparallel do
45 | Rake::Task[:lint].invoke
46 | Rake::Task[:validate].invoke
47 | Rake::Task[:spec].invoke
48 | Rake::Task["check:symlinks"].invoke
49 | Rake::Task["check:test_file"].invoke
50 | Rake::Task["check:dot_underscore"].invoke
51 | Rake::Task["check:git_ignore"].invoke
52 | end
53 |
54 | if Bundler.rubygems.find_name('puppet-blacksmith').any? && Bundler.rubygems.find_name('vandamme').any?
55 | bsmith = Blacksmith::RakeTask.new do |t|
56 | t.tag_message_pattern = "Version %s" # Signed tags must have a message
57 | t.tag_sign = true # enable GPG signing
58 | end
59 |
60 | desc 'Tag git (signed), push tag, interactively verify changelog, create GitHub Release'
61 | task :github_release do
62 | fail('ERROR: you must export GITHUB_TOKEN env var') unless ENV.include?('GITHUB_TOKEN')
63 | client = Octokit::Client.new(access_token: ENV['GITHUB_TOKEN'])
64 | # ensure we have valid auth
65 | client.user
66 | # get the module version
67 | mod = Blacksmith::Modulefile.new
68 | modver = mod.version
69 | modtag = "v#{modver}"
70 | # make sure we don't already have a release for it
71 | client.releases('jantman/puppet-archlinux-macbookretina').each do |r|
72 | abort("ERROR: GitHub Release already exists for tag #{modtag}") if modtag == r.tag_name
73 | end
74 | puts "Module version: #{modver}"
75 | chglog = Vandamme::Parser.new(
76 | changelog: File.read('CHANGELOG.md'),
77 | version_header_exp: /## \[(\d+\.\d+\.\d+)\] Released (\d{4}-\d{2}-\d{2})/,
78 | format: 'markdown'
79 | ).parse
80 | fail("ERROR: no CHANGELOG.md entry for version #{modver}") unless chglog.has_key?(modver)
81 | puts "Changelog for #{modver}:\n\n#{chglog[modver]}\n\n"
82 | print "Does this look correct? [y|N] "
83 | abort('Aborted! Exiting.') unless STDIN.gets.strip == 'y'
84 | puts "Tagging..."
85 | Rake::Task["module:tag"].invoke
86 | puts "Pushing git with tags..."
87 | bsmith.git.push!
88 | puts "Creating GitHub Release..."
89 | rel = client.create_release(
90 | 'jantman/puppet-archlinux-macbookretina',
91 | modtag,
92 | name: modver,
93 | body: chglog[modver]
94 | )
95 | puts "Created release: #{rel.html_url}"
96 | end
97 | end
98 |
99 | if Bundler.rubygems.find_name('puppet-strings').any?
100 | # Reimplement puppet-strings "strings:generate" task with custom params
101 | desc 'Generate Puppet documentation with YARD.'
102 | task :docs do
103 | patterns = PuppetStrings::DEFAULT_SEARCH_PATTERNS
104 |
105 | meta = JSON.parse(File.read('metadata.json'))
106 | options = {
107 | debug: false,
108 | backtrace: true,
109 | markup: 'markdown',
110 | yard_args: ['--title', "Puppet module jantman/archlinux_macbookretina #{meta['version']}"],
111 | }
112 |
113 | PuppetStrings.generate(patterns, options)
114 | end
115 | end
116 |
--------------------------------------------------------------------------------
/appveyor.yml:
--------------------------------------------------------------------------------
1 | version: 1.1.x.{build}
2 | skip_commits:
3 | message: /^\(?doc\)?.*/
4 | clone_depth: 10
5 | init:
6 | - SET
7 | - 'mkdir C:\ProgramData\PuppetLabs\code && exit 0'
8 | - 'mkdir C:\ProgramData\PuppetLabs\facter && exit 0'
9 | - 'mkdir C:\ProgramData\PuppetLabs\hiera && exit 0'
10 | - 'mkdir C:\ProgramData\PuppetLabs\puppet\var && exit 0'
11 | environment:
12 | matrix:
13 | - PUPPET_GEM_VERSION: ~> 4.0
14 | RUBY_VER: 21
15 | - PUPPET_GEM_VERSION: ~> 4.0
16 | RUBY_VER: 21-x64
17 | - PUPPET_GEM_VERSION: ~> 5.0
18 | RUBY_VER: 24
19 | - PUPPET_GEM_VERSION: ~> 5.0
20 | RUBY_VER: 24-x64
21 | - PUPPET_GEM_VERSION: 4.7.1
22 | RUBY_VER: 21-x64
23 | matrix:
24 | fast_finish: true
25 | install:
26 | - SET PATH=C:\Ruby%RUBY_VER%\bin;%PATH%
27 | - ps: |
28 | gem list openssl
29 | ruby -ropenssl -e 'puts \"OpenSSL Version - #{OpenSSL::OPENSSL_VERSION}\"; puts \"OpenSSL Library Version - #{OpenSSL::OPENSSL_LIBRARY_VERSION}\"'
30 | - bundle install --jobs 4 --retry 2 --without system_tests
31 | - type Gemfile.lock
32 | build: off
33 | test_script:
34 | - bundle exec puppet -V
35 | - ruby -v
36 | - bundle exec rake spec SPEC_OPTS='--format documentation'
37 | notifications:
38 | - provider: Email
39 | to:
40 | - nobody@nowhere.com
41 | on_build_success: false
42 | on_build_failure: false
43 | on_build_status_changed: false
44 |
--------------------------------------------------------------------------------
/files/60-schedulers.rules:
--------------------------------------------------------------------------------
1 | ##############################################################
2 | # WARNING - WARNING - WARNING
3 | # This file is managed by the archlinux_macbookretina
4 | # puppet module. Any local changes made here will be
5 | # overwritten on the next Puppet run. Please change the
6 | # file in the puppet module for persistent changes.
7 | ##############################################################
8 |
9 | # set deadline scheduler for non-rotating disks
10 | ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="deadline"
11 |
12 | # set cfq scheduler for rotating disks
13 | ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="cfq"
14 |
--------------------------------------------------------------------------------
/files/apple.conf:
--------------------------------------------------------------------------------
1 | ##############################################################
2 | # WARNING - WARNING - WARNING
3 | # This file is managed by the archlinux_macbookretina
4 | # puppet module. Any local changes made here will be
5 | # overwritten on the next Puppet run. Please change the
6 | # file in the puppet module for persistent changes.
7 | ##############################################################
8 |
9 | options hid_apple fnmode=2
10 |
--------------------------------------------------------------------------------
/files/kbd_backlight.conf:
--------------------------------------------------------------------------------
1 | ##############################################################
2 | # WARNING - WARNING - WARNING
3 | # This file is managed by the archlinux_macbookretina
4 | # puppet module. Any local changes made here will be
5 | # overwritten on the next Puppet run. Please change the
6 | # file in the puppet module for persistent changes.
7 | ##############################################################
8 | [Unit]
9 | Requires=upower.service
10 | After=upower.service
11 |
--------------------------------------------------------------------------------
/files/laptop-mode.conf:
--------------------------------------------------------------------------------
1 | ##############################################################
2 | # WARNING - WARNING - WARNING
3 | # This file is managed by the archlinux_macbookretina
4 | # puppet module. Any local changes made here will be
5 | # overwritten on the next Puppet run. Please change the
6 | # file in the puppet module for persistent changes.
7 | ##############################################################
8 |
9 | ###############################################################################
10 | #
11 | # Configuration for Laptop Mode Tools
12 | # -----------------------------------
13 | #
14 | # There is a "system" to the configuration setting names:
15 | # CONTROL_something=0/1 Determines whether Laptop Mode Tools controls
16 | # something
17 | # LM_something=value Value of "something" when laptop mode is active
18 | # NOLM_something=value Value of "something" when laptop mode is NOT
19 | # active
20 | # AC_something=value Value of "something" when the computer is running
21 | # on AC power
22 | # BATT_something=value Value of "something when the computer is running
23 | # on battery power
24 | #
25 | # There can be combinations of LM_/NOLM_ and AC_/BATT_ prefixes, but the
26 | # available prefixes are different for each setting. The available ones are
27 | # documented in the manual page, laptop-mode.conf(8). If there is no LM_/
28 | # NOLM_ in a setting name, then the value is used independently of laptop
29 | # mode state, and similarly, if there is no AC_/BATT_, then the value is used
30 | # independently of power state.
31 | #
32 | # Some options only work on ACPI systems. They are marked ACPI-ONLY.
33 | #
34 | # Note that this configuration file is a fragment of shell script: you
35 | # can use all the features of the shell scripting language to achieve your
36 | # desired configuration.
37 | #
38 | #
39 | # Modules
40 | # -------
41 | #
42 | # Laptop Mode Tools modules have separate configuration files, that can be
43 | # found in /etc/laptop-mode/conf.d. Please look through these configuration
44 | # files as well, there are many useful power saving tools in there!
45 | #
46 | ###############################################################################
47 |
48 |
49 | ###############################################################################
50 | # Enable/Disable laptop-mode-tools execution
51 | # ------------------------------------------
52 | # Set it to 0 to completely disable laptop-mode-tools from running
53 | ###############################################################################
54 | #
55 | ENABLE_LAPTOP_MODE_TOOLS=1
56 |
57 |
58 | ###############################################################################
59 | # Configuration debugging
60 | # -----------------------
61 | ###############################################################################
62 |
63 | #
64 | # Set this to 1 if you want to see a lot of information when you start/stop
65 | # laptop_mode.
66 | #
67 | VERBOSE_OUTPUT=0
68 |
69 | # Set this to 1 if you want to log messages to syslog
70 | LOG_TO_SYSLOG=1
71 |
72 | # Run in shell debug mode
73 | # Enable this if you would like to execute the entire laptop-mode-tools program
74 | # in shell debug mode. Warning: This will create a lot of text output
75 | # If you are debugging an individual module, perhaps you would want to enable
76 | # each module specific debug mode (available in module conf files)
77 | DEBUG=0
78 |
79 | ###############################################################################
80 | # When to enable laptop mode
81 | # --------------------------
82 | #
83 | # "Laptop mode" is the mode in which laptop mode tools makes the computer
84 | # consume less power. This includes the kernel "laptop_mode" feature, which
85 | # allows your hard drives to spin down, as well as various other settings which
86 | # can be tweaked by laptop mode tools. You can enable or disable all of these
87 | # settings using the CONTROL_... options further down in this config file.
88 | ###############################################################################
89 |
90 |
91 | #
92 | # Enable laptop mode when on battery power.
93 | #
94 | ENABLE_LAPTOP_MODE_ON_BATTERY=1
95 |
96 |
97 | #
98 | # Enable laptop mode when on AC power.
99 | #
100 | ENABLE_LAPTOP_MODE_ON_AC=0
101 |
102 |
103 | #
104 | # Enable laptop mode when the laptop's lid is closed, even when we're on AC
105 | # power? (ACPI-ONLY)
106 | #
107 | ENABLE_LAPTOP_MODE_WHEN_LID_CLOSED=0
108 |
109 |
110 | #
111 | # Enable all simple zero-configuration auto modules
112 | # This option enables all simple modules (listed below) without requiring
113 | # the user to enable each module individually
114 | #
115 | # List of modules which can be automatically enabled with this setting are:
116 | #
117 | # ac97-powersave
118 | # cpufreq
119 | # dpms-standby
120 | # eee-superhe
121 | # ethernet
122 | # exec-commands
123 | # hal-polling
124 | # hdparm
125 | # intel-hda-powersave
126 | # intel-sata-powermgmt
127 | # nmi-watchdog
128 | # pcie-aspm
129 | # runtime-pm
130 | # sched-mc-power-savings
131 | # sched-smt-power-savings
132 | # terminal-blanking
133 | # usb-autosuspend
134 | # wireless-ipw-power
135 | # wireless-iwl-power
136 | # wireless-power
137 | #
138 | # Set this to 1 to enable all simple zero-configuration auto modules listed above.
139 | #
140 | # NOTE: You can explicitly enable/disable any of the above modules by changing their
141 | # values in the individual settings file
142 | #
143 | ENABLE_AUTO_MODULES=1
144 |
145 |
146 |
147 | ###############################################################################
148 | # When to enable data loss sensitive features
149 | # -------------------------------------------
150 | #
151 | # When data loss sensitive features are disabled, laptop mode tools acts as if
152 | # laptop mode were disabled, for those features only.
153 | #
154 | # Data loss sensitive features include:
155 | # - laptop_mode (i.e., delayed writes)
156 | # - hard drive write cache
157 | #
158 | # All of the options that follow can be set to 0 in order to prevent laptop
159 | # mode tools from using them to stop data loss sensitive features. Use this
160 | # when you have a battery that reports the wrong information, that confuses
161 | # laptop mode tools.
162 | #
163 | # Disabling data loss sensitive features is ACPI-ONLY, and it only works if
164 | # your battery gives off frequent ACPI events to indicate a change in battery
165 | # level.
166 | #
167 | # NOTE: If your battery does NOT give off battery events often enough, you can
168 | # enable the battery-level-polling module to make this work. Look at the
169 | # file /etc/laptop-mode/conf.d/battery-level-polling.conf for more information.
170 | #
171 | ###############################################################################
172 |
173 |
174 | #
175 | # Disable all data loss sensitive features when the battery level (in % of the
176 | # battery capacity) reaches this value.
177 | #
178 | MINIMUM_BATTERY_CHARGE_PERCENT=3
179 |
180 |
181 | #
182 | # Disable data loss sensitive features when the battery reports its state
183 | # as "critical".
184 | #
185 | DISABLE_LAPTOP_MODE_ON_CRITICAL_BATTERY_LEVEL=1
186 |
187 |
188 | #
189 | # Ignore the alarm value reported by your batteries. In some instances a
190 | # a battery will report an abnormally high alarm value, resulting in data-loss
191 | # sensitive features being disabled prematurely.
192 | #
193 | DISABLE_BATTERY_ALARM_CHECK=0
194 |
195 |
196 | ###############################################################################
197 | # Controlled hard drives and partitions
198 | # -------------------------------------
199 | #
200 | # For spinning down your hard drives, laptop mode will remount file systems and
201 | # adjust hard drive spindown timeouts. These parameters specify which
202 | # devices and partitions are affected by laptop mode.
203 | ###############################################################################
204 |
205 |
206 | #
207 | # The drives that laptop mode controls.
208 | # Separate them by a space, e.g. HD="/dev/hda /dev/hdb". The default is a
209 | # wildcard, which will get you all your IDE and SCSI/SATA drives.
210 | #
211 | HD="/dev/[hs]d[abcdefgh]"
212 |
213 |
214 | #
215 | # The partitions (or mount points) that laptop mode controls.
216 | # Separate the values by spaces. Use "auto" to indicate all partitions on drives
217 | # listed in HD. You can add things to "auto", e.g. "auto /dev/hdc3". You can
218 | # also specify mount points, e.g. "/mnt/data".
219 | #
220 | PARTITIONS="auto /dev/mapper/*"
221 |
222 |
223 | #
224 | # If this is enabled, laptop mode tools will assume that SCSI drives are
225 | # really SATA drives that only _look_ like SCSI drives, and will use hdparm
226 | # to control them. Set this to 0 if you have /dev/sd devices and you want
227 | # laptop mode tools to use the "sdparm" command to control them.
228 | #
229 | ASSUME_SCSI_IS_SATA=1
230 |
231 |
232 | ###############################################################################
233 | # Hard drive behaviour settings
234 | # -----------------------------
235 | #
236 | # These settings specify how laptop mode tools will adjust the various
237 | # parameters of your hard drives and file systems.
238 | ###############################################################################
239 |
240 |
241 | #
242 | # Maximum time, in seconds, of work that you are prepared to lose when your
243 | # system crashes or power runs out. This is the maximum time that Laptop Mode
244 | # will keep unsaved data waiting in memory before spinning up your hard drive.
245 | #
246 | LM_BATT_MAX_LOST_WORK_SECONDS=600
247 | LM_AC_MAX_LOST_WORK_SECONDS=360
248 |
249 |
250 | #
251 | # Should laptop mode tools control readahead?
252 | #
253 | CONTROL_READAHEAD=1
254 |
255 |
256 | #
257 | # Read-ahead, in kilobytes. You can spin down the disk while playing MP3/OGG
258 | # by setting the disk readahead to a reasonable size, e.g. 3072 (3 MB).
259 | # Effectively, the disk will read a complete MP3 at once, and will then spin
260 | # down while the MP3/OGG is playing. Don't set this too high, because the
261 | # readahead is applied to _all_ files that are read from disk.
262 | #
263 | LM_READAHEAD=3072
264 | NOLM_READAHEAD=128
265 |
266 |
267 | #
268 | # Should laptop mode tools add the "noatime" option to the mount options when
269 | # laptop mode is enabled?
270 | #
271 | CONTROL_NOATIME=0
272 |
273 | # Should laptop use relatime instead of noatime? The "relatime" mount option has
274 | # more standards-compliant semantics, and allows more applications to work,
275 | # while retaining a low level of atime updates (i.e., disk writes).
276 | USE_RELATIME=1
277 |
278 |
279 | #
280 | # Should laptop mode tools control the hard drive idle timeout settings?
281 | #
282 | CONTROL_HD_IDLE_TIMEOUT=1
283 |
284 |
285 | #
286 | # Idle timeout values. (hdparm -S)
287 | # Default is 2 hours on AC (NOLM_HD_IDLE_TIMEOUT_SECONDS=7200) and 20 seconds
288 | # for battery and for AC with laptop mode on.
289 | #
290 | LM_AC_HD_IDLE_TIMEOUT_SECONDS=20
291 | LM_BATT_HD_IDLE_TIMEOUT_SECONDS=20
292 | NOLM_HD_IDLE_TIMEOUT_SECONDS=7200
293 |
294 |
295 | #
296 | # Should laptop mode tools control the hard drive power management settings?
297 | #
298 | # Set to 0 to disable
299 | CONTROL_HD_POWERMGMT="auto"
300 |
301 |
302 | #
303 | # Power management for HD (hdparm -B values)
304 | #
305 | BATT_HD_POWERMGMT=1
306 | LM_AC_HD_POWERMGMT=254
307 | NOLM_AC_HD_POWERMGMT=254
308 |
309 |
310 | #
311 | # Should laptop mode tools control the hard drive write cache settings?
312 | #
313 | CONTROL_HD_WRITECACHE=0
314 |
315 |
316 | #
317 | # Write cache settings for HD (hdparm -W values)
318 | #
319 | NOLM_AC_HD_WRITECACHE=1
320 | NOLM_BATT_HD_WRITECACHE=0
321 | LM_HD_WRITECACHE=0
322 |
323 |
324 |
325 |
326 | ###############################################################################
327 | # Settings you probably don't want to touch
328 | # -----------------------------------------
329 | #
330 | # It is usually not necessary to change these parameters. They are included
331 | # for completeness' sake.
332 | ###############################################################################
333 |
334 |
335 | #
336 | # Change mount options on partitions in PARTITIONS? You don't really want to
337 | # disable this. If you do, then your hard drives will probably not spin down
338 | # anymore.
339 | #
340 | CONTROL_MOUNT_OPTIONS=1
341 |
342 |
343 | #
344 | # Dirty synchronous ratio. At this percentage of dirty pages the process
345 | # which calls write() does its own writeback.
346 | #
347 | LM_DIRTY_RATIO=60
348 | NOLM_DIRTY_RATIO=40
349 |
350 |
351 | #
352 | # Allowed dirty background ratio, in percent. Once DIRTY_RATIO has been
353 | # exceeded, the kernel will wake pdflush which will then reduce the amount
354 | # of dirty memory to dirty_background_ratio. Set this nice and low, so once
355 | # some writeout has commenced, we do a lot of it.
356 | #
357 | LM_DIRTY_BACKGROUND_RATIO=1
358 | NOLM_DIRTY_BACKGROUND_RATIO=10
359 |
360 |
361 | #
362 | # kernel default settings -- don't touch these unless you know what you're
363 | # doing.
364 | #
365 | DEF_UPDATE=5
366 | DEF_XFS_AGE_BUFFER=15
367 | DEF_XFS_SYNC_INTERVAL=30
368 | DEF_XFS_BUFD_INTERVAL=1
369 | DEF_MAX_AGE=30
370 |
371 |
372 | #
373 | # This must be adjusted manually to the value of HZ in the running kernel
374 | # on 2.4, until the XFS people change their 2.4 external interfaces to work in
375 | # centisecs. This can be automated, but it's a work in progress that still
376 | # needs some fixes. On 2.6 kernels, XFS uses USER_HZ instead of HZ for
377 | # external interfaces, and that is currently always set to 100. So you don't
378 | # need to change this on 2.6.
379 | #
380 | XFS_HZ=100
381 |
382 |
383 | #
384 | # Seconds laptop mode has to wait after the disk goes idle before doing
385 | # a sync.
386 | #
387 | LM_SECONDS_BEFORE_SYNC=2
388 |
389 |
390 |
--------------------------------------------------------------------------------
/files/xorg.conf.nouveau:
--------------------------------------------------------------------------------
1 | ##############################################################
2 | # WARNING - WARNING - WARNING
3 | # This file is managed by the archlinux_macbookretina
4 | # puppet module. Any local changes made here will be
5 | # overwritten on the next Puppet run. Please change the
6 | # file in the puppet module for persistent changes.
7 | ##############################################################
8 |
9 | Section "ServerLayout"
10 | Identifier "X.org Configured"
11 | Screen 0 "Screen0" 0 0
12 | InputDevice "Mouse0" "CorePointer"
13 | InputDevice "Keyboard0" "CoreKeyboard"
14 | EndSection
15 |
16 | Section "Files"
17 | ModulePath "/usr/lib/xorg/modules"
18 | FontPath "/usr/share/fonts/misc/"
19 | FontPath "/usr/share/fonts/TTF/"
20 | FontPath "/usr/share/fonts/OTF/"
21 | FontPath "/usr/share/fonts/Type1/"
22 | FontPath "/usr/share/fonts/100dpi/"
23 | FontPath "/usr/share/fonts/75dpi/"
24 | EndSection
25 |
26 | Section "Module"
27 | Load "glx"
28 | EndSection
29 |
30 | Section "InputDevice"
31 | Identifier "Keyboard0"
32 | Driver "kbd"
33 | EndSection
34 |
35 | Section "InputDevice"
36 | Identifier "Mouse0"
37 | Driver "mouse"
38 | Option "Protocol" "auto"
39 | Option "Device" "/dev/input/mice"
40 | Option "ZAxisMapping" "4 5 6 7"
41 | EndSection
42 |
43 | Section "InputClass"
44 | MatchIsTouchpad "on"
45 | Identifier "Touchpads"
46 | Driver "mtrack"
47 | Option "Sensitivity" "0.65"
48 | Option "IgnoreThumb" "true"
49 | Option "IgnorePalm" "true"
50 | Option "TapButton1" "1"
51 | Option "TapButton2" "2"
52 | Option "TapButton3" "3"
53 | Option "ClickFinger1" "1"
54 | Option "ClickFinger2" "3"
55 | Option "ClickFinger3" "2"
56 | Option "BottomEdge" "25"
57 | EndSection
58 |
59 | Section "Monitor"
60 | Identifier "Monitor0"
61 | VendorName "Monitor Vendor"
62 | ModelName "Monitor Model"
63 | EndSection
64 |
65 | Section "Device"
66 | ### Available Driver options are:-
67 | ### Values: : integer, : float, : "True"/"False",
68 | ### : "String", : " Hz/kHz/MHz",
69 | ### : "%"
70 | ### [arg]: arg optional
71 | #Option "SWcursor" # []
72 | #Option "HWcursor" # []
73 | #Option "NoAccel" # []
74 | #Option "ShadowFB" # []
75 | #Option "VideoKey" #
76 | #Option "WrappedFB" # []
77 | #Option "GLXVBlank" # []
78 | #Option "ZaphodHeads" #
79 | #Option "PageFlip" # []
80 | #Option "SwapLimit" #
81 | #Option "AsyncUTSDFS" # []
82 | Identifier "Card0"
83 | Driver "nouveau"
84 | BusID "PCI:1:0:0"
85 | EndSection
86 |
87 | Section "Screen"
88 | Identifier "Screen0"
89 | Device "Card0"
90 | Monitor "Monitor0"
91 | SubSection "Display"
92 | Viewport 0 0
93 | Depth 1
94 | EndSubSection
95 | SubSection "Display"
96 | Viewport 0 0
97 | Depth 4
98 | EndSubSection
99 | SubSection "Display"
100 | Viewport 0 0
101 | Depth 8
102 | EndSubSection
103 | SubSection "Display"
104 | Viewport 0 0
105 | Depth 15
106 | EndSubSection
107 | SubSection "Display"
108 | Viewport 0 0
109 | Depth 16
110 | EndSubSection
111 | SubSection "Display"
112 | Viewport 0 0
113 | Depth 24
114 | EndSubSection
115 | EndSection
116 |
117 |
--------------------------------------------------------------------------------
/files/xorg.conf.nvidia:
--------------------------------------------------------------------------------
1 | ##############################################################
2 | # WARNING - WARNING - WARNING
3 | # This file is managed by the archlinux_macbookretina
4 | # puppet module. Any local changes made here will be
5 | # overwritten on the next Puppet run. Please change the
6 | # file in the puppet module for persistent changes.
7 | ##############################################################
8 |
9 | Section "Device"
10 | Identifier "Device0"
11 | Driver "nvidia"
12 | VendorName "NVIDIA Corporation"
13 | Option "UseDPLib" "Off"
14 | EndSection
15 |
16 | Section "InputClass"
17 | MatchIsTouchpad "on"
18 | Identifier "Touchpads"
19 | Driver "mtrack"
20 | Option "Sensitivity" "0.65"
21 | Option "IgnoreThumb" "true"
22 | Option "IgnorePalm" "true"
23 | Option "TapButton1" "1"
24 | Option "TapButton2" "2"
25 | Option "TapButton3" "3"
26 | Option "ClickFinger1" "1"
27 | Option "ClickFinger2" "3"
28 | Option "ClickFinger3" "2"
29 | Option "BottomEdge" "25"
30 | EndSection
31 |
--------------------------------------------------------------------------------
/locales/config.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | # This is the project-specific configuration file for setting up
3 | # fast_gettext for your project.
4 | gettext:
5 | # This is used for the name of the .pot and .po files; they will be
6 | # called .pot?
7 | project_name: jantman-archlinux_macbookretina
8 | # This is used in comments in the .pot and .po files to indicate what
9 | # project the files belong to and should bea little more desctiptive than
10 | #
11 | package_name: jantman-archlinux_macbookretina
12 | # The locale that the default messages in the .pot file are in
13 | default_locale: en
14 | # The email used for sending bug reports.
15 | bugs_address: jason@jasonantman.com
16 | # The holder of the copyright.
17 | copyright_holder: Jason Antman
18 | # This determines which comments in code should be eligible for translation.
19 | # Any comments that start with this string will be externalized. (Leave
20 | # empty to include all.)
21 | comments_tag: TRANSLATOR
22 | # Patterns for +Dir.glob+ used to find all files that might contain
23 | # translatable content, relative to the project root directory
24 | source_files:
25 | - './lib/**/*.rb'
26 |
27 |
--------------------------------------------------------------------------------
/manifests/fstab_add_option.pp:
--------------------------------------------------------------------------------
1 | #
2 | # Adds a specified option from /etc/fstab entry for a specified filesystem
3 | #
4 | # @param drive the filesystem specifier, first column in /etc/fstab; defaults to
5 | # the resource title.
6 | # @param option the option to add
7 | # @param only_fstype optional; only apply to mounts with this filesystem
8 | #
9 | define archlinux_macbookretina::fstab_add_option (
10 | String $option,
11 | String $drive = $title,
12 | String $only_fstype = ''
13 | ) {
14 |
15 | # let us constrain to one fs type
16 | if $only_fstype == '' {
17 | $spec = "spec = '${drive}'"
18 | } else {
19 | $spec = "spec = '${drive}' and vfstype = '${only_fstype}'"
20 | }
21 |
22 | augeas {"sda_add_${option}_${drive}":
23 | context => '/files/etc/fstab',
24 | incl => '/etc/fstab',
25 | lens => 'fstab.lns',
26 | changes => [
27 | "ins opt after *[${spec}]/opt[last()]",
28 | "set *[${spec}]/opt[last()] ${option}",
29 | ],
30 | onlyif => "match *[${spec} and count(opt[.='${option}'])=0] size > 0",
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/manifests/fstab_remove_option.pp:
--------------------------------------------------------------------------------
1 | #
2 | # Removes a specified option from /etc/fstab entry for a specified filesystem
3 | #
4 | # @param drive the filesystem specifier, first column in /etc/fstab; defaults to
5 | # the resource title.
6 | # @param option the option to add
7 | # @param only_fstype optional; only apply to mounts with this filesystem
8 | #
9 | define archlinux_macbookretina::fstab_remove_option (
10 | String $option,
11 | String $drive = $title,
12 | String $only_fstype = ''
13 | ) {
14 |
15 | # let us constrain to one fs type
16 | if $only_fstype == '' {
17 | $spec = "spec = '${drive}'"
18 | } else {
19 | $spec = "spec = '${drive}' and vfstype = '${only_fstype}'"
20 | }
21 |
22 | augeas {"sda_remove_${option}_${drive}":
23 | context => '/files/etc/fstab',
24 | incl => '/etc/fstab',
25 | lens => 'fstab.lns',
26 | changes => [
27 | "rm *[${spec}]/opt[.='${option}']",
28 | ],
29 | onlyif => "match *[${spec}]/opt[.='${option}'] size > 0",
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/manifests/fstab_replace_option.pp:
--------------------------------------------------------------------------------
1 | #
2 | # Replace a specified option from /etc/fstab entry for a specified filesystem,
3 | # with another option
4 | #
5 | # @param drive the filesystem specifier, first column in /etc/fstab; defaults to
6 | # the resource title.
7 | # @param option the option to add
8 | # @param old_option the option to remove
9 | # @param only_fstype optional; only apply to mounts with this filesystem
10 | #
11 | define archlinux_macbookretina::fstab_replace_option (
12 | String $option,
13 | String $old_option,
14 | String $drive = $title,
15 | String $only_fstype = ''
16 | ) {
17 |
18 | # let us constrain to one fs type
19 | if $only_fstype == '' {
20 | $spec = "spec = '${drive}'"
21 | } else {
22 | $spec = "spec = '${drive}' and vfstype = '${only_fstype}'"
23 | }
24 |
25 | augeas {"sda_replace_remove_${old_option}_${drive}":
26 | context => '/files/etc/fstab',
27 | incl => '/etc/fstab',
28 | lens => 'fstab.lns',
29 | changes => [
30 | "rm *[${spec}]/opt[.='${old_option}']",
31 | ],
32 | onlyif => "match *[${spec}]/opt[.='${old_option}'] size > 0",
33 | }
34 |
35 | augeas {"sda_replace_add_${option}_${drive}":
36 | context => '/files/etc/fstab',
37 | incl => '/etc/fstab',
38 | lens => 'fstab.lns',
39 | changes => [
40 | "ins opt after *[${spec}]/opt[last()]",
41 | "set *[${spec}]/opt[last()] ${option}",
42 | ],
43 | onlyif => "match *[${spec} and count(opt[.='${option}'])=0] size > 0",
44 | }
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/manifests/init.pp:
--------------------------------------------------------------------------------
1 | #
2 | # Include all working archlinux_macbookretina::* classes. Ensure that this is
3 | # running on a supported hardware product, and fail otherwise.
4 | #
5 | class archlinux_macbookretina {
6 |
7 | # make sure we're on Arch, otherwise fail
8 | if $::osfamily != 'Archlinux' {
9 | fail("${::operatingsystem} not supported")
10 | }
11 |
12 | case $::productname {
13 | 'MacBookPro10,1': { $cant_have_an_empty_block = true }
14 | 'MacBookPro11,4': { $cant_have_an_empty_block = true }
15 | default: {
16 | fail("${::productname} is not a supported hardware productname")
17 | }
18 | }
19 |
20 | # Install proprietary nvidia driver for nvidia graphics
21 | class {'archlinux_macbookretina::videodriver':
22 | driver => 'nvidia', # default
23 | }
24 |
25 | # Install driver for Broadcom wireless, iw and wpa_supplicant
26 | include archlinux_macbookretina::wireless
27 |
28 | # setup the apple kernel module for the mac keyboard
29 | include archlinux_macbookretina::mac_keyboard
30 |
31 | # SSD tuning
32 | include archlinux_macbookretina::ssd
33 |
34 | # fan control
35 | include archlinux_macbookretina::macfanctld
36 |
37 | # touchpad setup
38 | include archlinux_macbookretina::touchpad
39 | }
40 |
--------------------------------------------------------------------------------
/manifests/mac_keyboard.pp:
--------------------------------------------------------------------------------
1 | #
2 | # Sets up macbook-specific keyboard stuff
3 | #
4 | # - set modprobe.d/apple.conf with "options hid_apple fnmode=2"
5 | # - set /etc/systemd/system/kdm.service.d/kbd_backlight.conf to start ``upower``
6 | # before SDDM
7 | #
8 | class archlinux_macbookretina::mac_keyboard {
9 |
10 | file { '/etc/modprobe.d/apple.conf':
11 | ensure => present,
12 | owner => 'root',
13 | group => 'root',
14 | mode => '0644',
15 | source => 'puppet:///modules/archlinux_macbookretina/apple.conf',
16 | }
17 |
18 | file { '/etc/systemd/system/kdm.service.d':
19 | ensure => directory,
20 | owner => 'root',
21 | group => 'root',
22 | mode => '0755',
23 | }
24 | -> file { '/etc/systemd/system/kdm.service.d/kbd_backlight.conf':
25 | ensure => present,
26 | owner => 'root',
27 | group => 'root',
28 | mode => '0644',
29 | source => 'puppet:///modules/archlinux_macbookretina/kbd_backlight.conf',
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/manifests/macfanctld.pp:
--------------------------------------------------------------------------------
1 | #
2 | # Install macfanctld package and enable the macfanctld service.
3 | #
4 | class archlinux_macbookretina::macfanctld {
5 |
6 | # AUR package
7 | package {'macfanctld':
8 | ensure => present,
9 | }
10 |
11 | service {'macfanctld':
12 | ensure => running,
13 | enable => true,
14 | }
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/manifests/ssd.pp:
--------------------------------------------------------------------------------
1 | #
2 | # Sets up SSD-specific tuning on the system.
3 | #
4 | # Currently only writes ``/etc/udev/rules.d/60-schedulers.rules`` to set rotational
5 | # disks (non-SSD) to use the CFQ scheduler, and non-rotational (SSD) to use
6 | # the deadline scheduler.
7 | #
8 | class archlinux_macbookretina::ssd {
9 |
10 | # CFQ is a *bad* scheduler for SSD. let's tell udev that we want to use deadline instead
11 | file {'/etc/udev/rules.d/60-schedulers.rules':
12 | ensure => present,
13 | owner => 'root',
14 | group => 'root',
15 | mode => '0644',
16 | source => 'puppet:///modules/archlinux_macbookretina/60-schedulers.rules',
17 | }
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/manifests/touchpad.pp:
--------------------------------------------------------------------------------
1 | #
2 | # Set up the MBP touchpad using synaptics driver and configure it.
3 | #
4 | # - install ``xf86-input-synaptics``
5 | # - ensure ``xf86-input-mtrack-git`` is absent
6 | # - setup ``/etc/X11/xorg.conf.d/00-touchpad.conf`` from template
7 | #
8 | class archlinux_macbookretina::touchpad {
9 |
10 | package {'xf86-input-mtrack-git':
11 | ensure => absent,
12 | }
13 |
14 | package {'xf86-input-synaptics':
15 | ensure => present,
16 | }
17 | -> file { '/etc/X11/xorg.conf.d/00-touchpad.conf':
18 | ensure => present,
19 | owner => 'root',
20 | group => 'root',
21 | mode => '0644',
22 | content => template('archlinux_macbookretina/00-touchpad.conf.erb'),
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/manifests/videodriver.pp:
--------------------------------------------------------------------------------
1 | #
2 | # Install driver for the MacBook Retina's NVidia graphics; either the
3 | # proprietary nvidia driver, or the open source noveau driver. Remove
4 | # whichever one isn't selected.
5 | #
6 | # @param driver either "nvidia" or "noveau", the one to install.
7 | # The other driver will be uninstalled. Defaults to the proprietary
8 | # "nvidia" per https://wiki.archlinux.org/index.php/MacBookPro11,x#Graphics
9 | #
10 | class archlinux_macbookretina::videodriver (
11 | String $driver = 'nvidia'
12 | ) {
13 |
14 | validate_re($driver, '^(nvidia|nouveau)$')
15 |
16 | $nouveau_packages = ['xf86-video-nouveau', 'nouveau-dri' ]
17 | # nvidia-bl is a backlight driver - https://aur.archlinux.org/packages/nvidia-bl/
18 | # https://wiki.archlinux.org/index.php/MacBookPro11,x#Screen_backlight seems to
19 | # indicate that this weird driver may not be needed anymore
20 | $nvidia_packages = [ 'nvidia' ]
21 |
22 | if $driver == 'nvidia' {
23 | $add_packages = $nvidia_packages
24 | $remove_packages = $nouveau_packages
25 | } else {
26 | $add_packages = $nouveau_packages
27 | $remove_packages = $nvidia_packages
28 | }
29 |
30 | package {$remove_packages :
31 | ensure => absent,
32 | install_options => '-dds',
33 | }
34 | -> package {$add_packages :
35 | ensure => present,
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/manifests/webcam.pp:
--------------------------------------------------------------------------------
1 | #
2 | # On MacBookPro11,4 install reverse-engineered driver for FacetimeHD (Broadcom
3 | # 1570) PCIe webcam, using AUR packages (``bcwc-pcie-git`` and
4 | # ``facetimehd-firmware``). Driver source:
5 | # https://github.com/patjak/bcwc_pcie/. On other models, do nothing.
6 | #
7 | class archlinux_macbookretina::webcam {
8 |
9 | case $::productname {
10 | 'MacBookPro11,4': {
11 | package {'bcwc-pcie-git':
12 | ensure => present,
13 | }
14 |
15 | package {'facetimehd-firmware':
16 | ensure => present,
17 | }
18 | }
19 | default: {
20 | notify {"archlinux_macbookretina does not know how to configure webcam on: ${::productname}": }
21 | }
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/manifests/wireless.pp:
--------------------------------------------------------------------------------
1 | #
2 | # Install wireless drivers, ``iw`` and ``wpa_supplicant``.
3 | #
4 | # - On MacBookPro10,1 install the ``broadcom-wl`` driver.
5 | # - On other models, use the build-in kernel drivers.
6 | #
7 | class archlinux_macbookretina::wireless {
8 |
9 | case $::productname {
10 | 'MacBookPro10,1': {
11 | # we could also use the open source [b43-firmware](https://aur.archlinux.org/packages/b43-firmware/)
12 | # for a custom kernel, we'll need https://aur.archlinux.org/packages/broadcom-wl-dkms/
13 | package {'broadcom-wl':
14 | ensure => present,
15 | }
16 | }
17 | default: {
18 | notify {"using built-in kernel drivers for wireless on ${::productname}": }
19 | }
20 | }
21 |
22 | package {'iw':
23 | ensure => present,
24 | }
25 |
26 | package {'wpa_supplicant':
27 | ensure => present,
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/metadata.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "jantman-archlinux_macbookretina",
3 | "version": "0.3.1",
4 | "summary": "Configure Arch Linux on a MacBook Retina",
5 | "author": "jantman",
6 | "description": "Provides many classes (and a sane default class/init.pp) for configuring Arch Linux on a MacBook Retina.",
7 | "dependencies": [
8 | {
9 | "name": "puppetlabs/stdlib",
10 | "version_requirement": ">=4.1.0 <4.13.0"
11 | },
12 | {
13 | "name": "puppetlabs/firewall",
14 | "version_requirement": ">= 1.0.0 <2.0.0"
15 | },
16 | {
17 | "name": "duritong/sysctl",
18 | "version_requirement": ">= 0.0.11 <1.0.0"
19 | }
20 | ],
21 | "operatingsystem_support": [
22 | {
23 | "operatingsystem": "Archlinux"
24 | }
25 | ],
26 | "requirements": [
27 | {
28 | "name": "puppet",
29 | "version_requirement": ">= 4.0.0 < 6.0.0"
30 | }
31 | ],
32 | "checksums": {},
33 | "source": "https://github.com/jantman/puppet-archlinux-macbookretina",
34 | "project_page": "https://github.com/jantman/puppet-archlinux-macbookretina",
35 | "license": "GPL-3.0"
36 | }
37 |
--------------------------------------------------------------------------------
/spec/acceptance/classes/mac_keyboard_spec.rb:
--------------------------------------------------------------------------------
1 | require 'spec_helper_acceptance'
2 |
3 | describe 'archlinux_macbookretina::mac_keyboard class' do
4 |
5 | context 'default parameters' do
6 | # Using puppet_apply as a helper
7 | it 'should work with no errors' do
8 | pp = <<-EOS
9 | class { 'archlinux_macbookretina::mac_keyboard': }
10 | EOS
11 |
12 | # Run it twice and test for idempotency
13 | apply_manifest(pp, :catch_failures => true)
14 | apply_manifest(pp, :catch_changes => true)
15 | end
16 |
17 | describe file('/etc/modprobe.d/apple.conf') do
18 | it { should be_file }
19 | it { should be_owned_by 'root' }
20 | it { should be_grouped_into 'root' }
21 | it { should be_mode 644 }
22 | its(:content) { should match /options hid_apple fnmode=2/ }
23 | end
24 |
25 | describe file('/etc/systemd/system/kdm.service.d/kbd_backlight.conf') do
26 | it { should be_file }
27 | it { should be_owned_by 'root' }
28 | it { should be_grouped_into 'root' }
29 | it { should be_mode 644 }
30 | its(:content) { should contain('Requires=upower.service') }
31 | its(:content) { should contain('After=upower.service') }
32 | end
33 |
34 | describe file('/etc/systemd/system/kdm.service.d') do
35 | it { should be_directory }
36 | it { should be_owned_by 'root' }
37 | it { should be_grouped_into 'root' }
38 | it { should be_mode 755 }
39 | end
40 | end
41 | end
42 |
--------------------------------------------------------------------------------
/spec/acceptance/classes/macfanctld.rb:
--------------------------------------------------------------------------------
1 | require 'spec_helper_acceptance'
2 |
3 | describe 'archlinux_macbookretina::wireless class' do
4 |
5 | context 'default parameters' do
6 | # Using puppet_apply as a helper
7 | it 'should work with no errors' do
8 | pp = <<-EOS
9 | class { 'archlinux_macbookretina::wireless': }
10 | EOS
11 |
12 | # Run it twice and test for idempotency
13 | apply_manifest(pp, :catch_failures => true)
14 | apply_manifest(pp, :catch_changes => true)
15 | end
16 |
17 | describe package('broadcom-wl') do
18 | it { should_not be_installed }
19 | end
20 |
21 | describe package('iw') do
22 | it { should be_installed }
23 | end
24 |
25 | describe package('wpa_supplicant') do
26 | it { should be_installed }
27 | end
28 | end
29 | end
30 |
--------------------------------------------------------------------------------
/spec/acceptance/classes/ssd_spec.rb:
--------------------------------------------------------------------------------
1 | require 'spec_helper_acceptance'
2 |
3 | describe 'archlinux_macbookretina::ssd class' do
4 |
5 | context 'default parameters' do
6 | # Using puppet_apply as a helper
7 | it 'should work with no errors' do
8 | pp = <<-EOS
9 | class { 'archlinux_macbookretina::ssd': }
10 | EOS
11 |
12 | # Run it twice and test for idempotency
13 | apply_manifest(pp, :catch_failures => true)
14 | apply_manifest(pp, :catch_changes => true)
15 | end
16 |
17 | describe file('/etc/udev/rules.d/60-schedulers.rules') do
18 | it { should be_file }
19 | it { should be_owned_by 'root' }
20 | it { should be_grouped_into 'root' }
21 | it { should be_mode 644 }
22 | its(:content) { should contain('ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="deadline"') }
23 | its(:content) { should contain('ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="cfq"') }
24 | end
25 | end
26 | end
27 |
--------------------------------------------------------------------------------
/spec/acceptance/classes/videodriver_spec.rb:
--------------------------------------------------------------------------------
1 | require 'spec_helper_acceptance'
2 |
3 | describe 'archlinux_macbookretina::videodriver class' do
4 |
5 | context 'default parameters' do
6 | # Using puppet_apply as a helper
7 | it 'should work with no errors' do
8 | pp = <<-EOS
9 | class { 'archlinux_workstation': username => 'myuser', } ->
10 | class { 'archlinux_workstation::repos::jantman': } ->
11 | class { 'archlinux_macbookretina::videodriver': }
12 | EOS
13 |
14 | # Run it twice and test for idempotency
15 | apply_manifest(pp, :catch_failures => true)
16 | apply_manifest(pp, :catch_changes => true)
17 | end
18 |
19 | nouveau_packages = ['xf86-video-nouveau' ]
20 | nvidia_packages = [ 'nvidia' ]
21 |
22 | nvidia_packages.each do |pkgname|
23 | describe package(pkgname) do
24 | it { should be_installed }
25 | end
26 | end
27 |
28 | nouveau_packages.each do |pkgname|
29 | describe package(pkgname) do
30 | it { should_not be_installed }
31 | end
32 | end
33 | end
34 | end
35 |
--------------------------------------------------------------------------------
/spec/acceptance/classes/webcam_spec.rb:
--------------------------------------------------------------------------------
1 | require 'spec_helper_acceptance'
2 |
3 | describe 'archlinux_macbookretina::webcam class' do
4 |
5 | context 'default parameters' do
6 | # Using puppet_apply as a helper
7 | it 'should work with no errors' do
8 | pp = <<-EOS
9 | class { 'archlinux_macbookretina::webcam': }
10 | EOS
11 |
12 | # Run it twice and test for idempotency
13 | apply_manifest(pp, :catch_failures => true)
14 | apply_manifest(pp, :catch_changes => true)
15 | end
16 |
17 | describe package('bcwc-pcie-git') do
18 | it { should be_installed }
19 | end
20 |
21 | describe package('facetimehd-firmware') do
22 | it { should be_installed }
23 | end
24 | end
25 | end
26 |
--------------------------------------------------------------------------------
/spec/acceptance/classes/wireless_spec.rb:
--------------------------------------------------------------------------------
1 | require 'spec_helper_acceptance'
2 |
3 | describe 'archlinux_macbookretina::wireless class' do
4 |
5 | context 'default parameters' do
6 | # Using puppet_apply as a helper
7 | it 'should work with no errors' do
8 | pp = <<-EOS
9 | class { 'archlinux_macbookretina::wireless': }
10 | EOS
11 |
12 | # Run it twice and test for idempotency
13 | # Because of the notify we can't detect changes
14 | apply_manifest(pp, :catch_failures => true)
15 | apply_manifest(pp, :catch_failures => true)
16 | end
17 |
18 | describe package('broadcom-wl') do
19 | it { should_not be_installed }
20 | end
21 |
22 | describe package('iw') do
23 | it { should be_installed }
24 | end
25 |
26 | describe package('wpa_supplicant') do
27 | it { should be_installed }
28 | end
29 | end
30 | end
31 |
--------------------------------------------------------------------------------
/spec/acceptance/classes/xx_touchpad_spec.rb:
--------------------------------------------------------------------------------
1 | # This must run after the videodriver spec, as it needs xorg-server
2 | require 'spec_helper_acceptance'
3 |
4 | describe 'archlinux_macbookretina::touchpad class' do
5 |
6 | context 'default parameters' do
7 | # Using puppet_apply as a helper
8 | it 'should work with no errors' do
9 | pp = <<-EOS
10 | class { 'archlinux_macbookretina::touchpad': }
11 | EOS
12 |
13 | # Run it twice and test for idempotency
14 | apply_manifest(pp, :catch_failures => true)
15 | apply_manifest(pp, :catch_changes => true)
16 | end
17 |
18 | describe package('xf86-input-mtrack-git') do
19 | it { should_not be_installed }
20 | end
21 |
22 | describe package('xf86-input-synaptics') do
23 | it { should be_installed }
24 | end
25 |
26 | describe file('/etc/X11/xorg.conf.d/00-touchpad.conf') do
27 | it { should be_file }
28 | it { should be_owned_by 'root' }
29 | it { should be_grouped_into 'root' }
30 | it { should be_mode 644 }
31 | its(:content) { should match /Driver\s+"synaptics"/ }
32 | end
33 | end
34 | end
35 |
--------------------------------------------------------------------------------
/spec/acceptance/nodesets/default.yml:
--------------------------------------------------------------------------------
1 | HOSTS:
2 | archlinux-current-x64:
3 | platform: archlinux-current-amd64
4 | hypervisor: docker
5 | image: archlinux/base:latest
6 | docker_preserve_image: true
7 | docker_cmd: '["/usr/lib/systemd/systemd"]'
8 | docker_cap_add: ['SYS_ADMIN']
9 | mount_folders:
10 | cgroup:
11 | host_path: /sys/fs/cgroup
12 | container_path: /sys/fs/cgroup
13 | opts: ro
14 | docker_image_commands:
15 | - 'echo "en_US.UTF-8 UTF-8" > /etc/locale.gen'
16 | - 'pacman -S --noconfirm grep tar'
17 | CONFIG:
18 | trace_limit: 200
19 |
--------------------------------------------------------------------------------
/spec/acceptance_test_fact_overrides.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | productname: 'MacBookPro11,4'
3 |
--------------------------------------------------------------------------------
/spec/classes/coverage_spec.rb:
--------------------------------------------------------------------------------
1 | at_exit { RSpec::Puppet::Coverage.report! }
2 |
--------------------------------------------------------------------------------
/spec/classes/init_spec.rb:
--------------------------------------------------------------------------------
1 | require 'spec_helper'
2 |
3 | describe 'archlinux_macbookretina' do
4 | let(:facts) { spec_facts }
5 |
6 | context 'supported operating systems' do
7 | describe "archlinux_macbookretina class with username parameter on Archlinux" do
8 | it { should compile.with_all_deps }
9 | it { should contain_class('archlinux_macbookretina') }
10 | end
11 | end
12 |
13 | context 'unsupported operating system' do
14 | describe 'archlinux_macbookretina class without any parameters on Solaris/Nexenta' do
15 | let(:facts) { spec_facts(
16 | :osfamily => 'Solaris',
17 | :operatingsystem => 'Nexenta',
18 | :os => { 'family' => 'Solaris', 'name' => 'Nexenta', },
19 | ) }
20 |
21 | it { expect { should contain_class('archlinux_macbookretina') }.to raise_error(Puppet::Error, /Nexenta not supported/) }
22 | end
23 | describe 'archlinux_macbookretina class without any parameters on CentOS' do
24 | let(:facts) { spec_facts(
25 | :osfamily => 'RedHat',
26 | :operatingsystem => 'CentOS',
27 | # structured facts
28 | :os => { 'family' => 'RedHat', 'name' => 'CentOS', },
29 | ) }
30 |
31 | it { expect { should contain_class('archlinux_macbookretina') }.to raise_error(Puppet::Error, /CentOS not supported/) }
32 | end
33 | describe 'archlinux_macbookretina class without any parameters on Debian' do
34 | let(:facts) { spec_facts(
35 | :osfamily => 'Debian',
36 | :operatingsystem => 'debian',
37 | # structured facts
38 | :os => { 'family' => 'Debian', 'name' => 'debian', },
39 | ) }
40 |
41 | it { expect { should contain_class('archlinux_macbookretina') }.to raise_error(Puppet::Error, /debian not supported/) }
42 | end
43 | end
44 |
45 | context 'supported hardware' do
46 | describe 'MacBookPro10,1' do
47 | let(:facts) { spec_facts(
48 | :productname => 'MacBookPro10,1',
49 | :dmi => { 'product' => { 'name' => 'MacBookPro10,1' } },
50 | ) }
51 |
52 | it { should compile.with_all_deps }
53 | it { should contain_class('archlinux_macbookretina') }
54 | end
55 | describe 'MacBookPro11,4' do
56 | let(:facts) { spec_facts }
57 |
58 | it { should compile.with_all_deps }
59 | it { should contain_class('archlinux_macbookretina') }
60 | end
61 | end
62 |
63 | context 'unsupported hardware' do
64 | describe 'To be filled by O.E.M.' do
65 | let(:facts) { spec_facts(
66 | :productname => 'To be filled by O.E.M.',
67 | :dmi => { 'product' => { 'name' => 'To be filled by O.E.M.' } },
68 | ) }
69 | it { expect { should contain_class('archlinux_macbookretina') }.to raise_error(Puppet::Error, /To be filled by O\.E\.M\. is not a supported hardware productname/) }
70 | end
71 | end
72 | context 'parameters' do
73 | describe 'default' do
74 | let(:facts) { spec_facts }
75 |
76 | it { should compile.with_all_deps }
77 | it { should contain_class('archlinux_macbookretina') }
78 | it { should contain_class('archlinux_macbookretina::wireless') }
79 | it { should contain_class('archlinux_macbookretina::videodriver') }
80 | it { should contain_class('archlinux_macbookretina::mac_keyboard') }
81 | it { should contain_class('archlinux_macbookretina::ssd') }
82 | it { should contain_class('archlinux_macbookretina::macfanctld') }
83 | it { should contain_class('archlinux_macbookretina::touchpad') }
84 | end
85 | end
86 | end
87 |
--------------------------------------------------------------------------------
/spec/classes/mac_keyboard_spec.rb:
--------------------------------------------------------------------------------
1 | require 'spec_helper'
2 |
3 | describe 'archlinux_macbookretina::mac_keyboard' do
4 | let(:facts) { spec_facts }
5 |
6 | describe "creates file" do
7 | it { should compile.with_all_deps }
8 | it { should contain_class('archlinux_macbookretina::mac_keyboard') }
9 | it { should contain_file('/etc/modprobe.d/apple.conf')
10 | .with({
11 | :ensure => 'present',
12 | :owner => 'root',
13 | :group => 'root',
14 | :mode => '0644',
15 | :source => 'puppet:///modules/archlinux_macbookretina/apple.conf',
16 | })
17 | }
18 |
19 | it { should contain_file('/etc/systemd/system/kdm.service.d/kbd_backlight.conf')
20 | .with({
21 | :ensure => 'present',
22 | :owner => 'root',
23 | :group => 'root',
24 | :mode => '0644',
25 | :source => 'puppet:///modules/archlinux_macbookretina/kbd_backlight.conf',
26 | })
27 | }
28 |
29 | it { should contain_file('/etc/systemd/system/kdm.service.d')
30 | .with({
31 | :ensure => 'directory',
32 | :owner => 'root',
33 | :group => 'root',
34 | :mode => '0755',
35 | })
36 | .that_comes_before('File[/etc/systemd/system/kdm.service.d/kbd_backlight.conf]')
37 | }
38 | end
39 | end
40 |
--------------------------------------------------------------------------------
/spec/classes/macfanctld_spec.rb:
--------------------------------------------------------------------------------
1 | require 'spec_helper'
2 |
3 | describe 'archlinux_macbookretina::macfanctld' do
4 | let(:facts) { spec_facts }
5 |
6 | describe "installs packages" do
7 | it { should compile.with_all_deps }
8 | it { should contain_package('macfanctld').with_ensure('present') }
9 | it { should contain_service('macfanctld')
10 | .with_ensure('running')
11 | .with_enable(true)
12 | }
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/spec/classes/ssd_spec.rb:
--------------------------------------------------------------------------------
1 | require 'spec_helper'
2 |
3 | describe 'archlinux_macbookretina::ssd' do
4 | let(:facts) { spec_facts }
5 |
6 | describe "installs packages" do
7 | it { should compile.with_all_deps }
8 |
9 | it { should contain_class('archlinux_macbookretina::ssd') }
10 | it { should contain_file('/etc/udev/rules.d/60-schedulers.rules').with({
11 | :ensure => 'present',
12 | :owner => 'root',
13 | :group => 'root',
14 | :mode => '0644',
15 | :source => 'puppet:///modules/archlinux_macbookretina/60-schedulers.rules',
16 | })
17 | }
18 |
19 | it { should_not contain_sysctl__value('vm.dirty_writeback_centisecs') }
20 | it { should_not contain_sysctl__value('vm.laptop_mode') }
21 | it { should_not contain_sysctl__value('vm.swappiness') }
22 | it { should_not contain_sysctl__value('vm.vfs_cache_pressure') }
23 | end
24 | end
25 |
--------------------------------------------------------------------------------
/spec/classes/touchpad_spec.rb:
--------------------------------------------------------------------------------
1 | require 'spec_helper'
2 |
3 | describe 'archlinux_macbookretina::touchpad' do
4 | let(:facts) { spec_facts }
5 |
6 | describe "creates file" do
7 | it { should compile.with_all_deps }
8 | it { should contain_class('archlinux_macbookretina::touchpad') }
9 | it { should contain_package('xf86-input-synaptics').with_ensure('present') }
10 | it { should contain_package('xf86-input-mtrack-git').with_ensure('absent') }
11 | it { should contain_file('/etc/X11/xorg.conf.d/00-touchpad.conf')
12 | .with_ensure('present')
13 | .with_owner('root')
14 | .with_group('root')
15 | .with_mode('0644')
16 | .with_content(/Driver\s+"synaptics"/)
17 | }
18 | end
19 | end
20 |
--------------------------------------------------------------------------------
/spec/classes/videodriver_spec.rb:
--------------------------------------------------------------------------------
1 | require 'spec_helper'
2 |
3 | describe 'archlinux_macbookretina::videodriver' do
4 | let(:facts) { spec_facts }
5 |
6 | context 'invalid driver param' do
7 | let(:params) {{ :driver => 'foo' }}
8 |
9 | describe "raises error" do
10 | it { expect { should contain_class('archlinux_macbookretina::videodriver') }.to raise_error(Puppet::Error, /"foo" does not match/) }
11 | end
12 | end
13 | context 'default params' do
14 | let(:params) {{ }}
15 | describe "installs packages" do
16 | it { should compile.with_all_deps }
17 | it { should contain_class('archlinux_macbookretina::videodriver') }
18 |
19 | nouveau_packages = ['xf86-video-nouveau', 'nouveau-dri' ]
20 | nvidia_packages = [ 'nvidia' ]
21 |
22 | nvidia_packages.each do |pkgname|
23 | it { should contain_package(pkgname)
24 | .with_ensure('present')
25 | }
26 | end
27 | nouveau_packages.each do |pkgname|
28 | it { should contain_package(pkgname)
29 | .with_ensure('absent')
30 | .with_install_options('-dds')
31 | .that_comes_before('Package[nvidia]')
32 | }
33 | end
34 | end
35 | end
36 | context 'driver param set to nouveau' do
37 | let(:params) {{ :driver => 'nouveau' }}
38 | describe "installs packages" do
39 | it { should compile.with_all_deps }
40 | it { should contain_class('archlinux_macbookretina::videodriver') }
41 |
42 | nouveau_packages = ['xf86-video-nouveau', 'nouveau-dri' ]
43 | nvidia_packages = [ 'nvidia' ]
44 |
45 | nouveau_packages.each do |pkgname|
46 | it { should contain_package(pkgname)
47 | .with_ensure('present')
48 | }
49 | end
50 | nvidia_packages.each do |pkgname|
51 | it { should contain_package(pkgname)
52 | .with_ensure('absent')
53 | .with_install_options('-dds')
54 | .that_comes_before('Package[xf86-video-nouveau]')
55 | }
56 | end
57 | end
58 | end
59 | end
60 |
--------------------------------------------------------------------------------
/spec/classes/webcam_spec.rb:
--------------------------------------------------------------------------------
1 | require 'spec_helper'
2 |
3 | describe 'archlinux_macbookretina::webcam' do
4 | let(:facts) { spec_facts }
5 |
6 | describe "installs packages" do
7 | it { should compile.with_all_deps }
8 | it { should contain_package('bcwc-pcie-git').with_ensure('present') }
9 | it { should contain_package('facetimehd-firmware').with_ensure('present') }
10 | end
11 | describe 'uses broadcom-wl on MBP 10,1' do
12 | let(:facts) { spec_facts(
13 | :productname => 'MacBookPro10,1',
14 | :dmi => { 'product' => { 'name' => 'MacBookPro10,1' } },
15 | ) }
16 |
17 | it { should compile.with_all_deps }
18 | it { should_not contain_package('bcwc-pcie-git') }
19 | it { should_not contain_package('facetimehd-firmware') }
20 | it { should contain_notify('archlinux_macbookretina does not know how to configure webcam on: MacBookPro10,1') }
21 | end
22 | end
23 |
--------------------------------------------------------------------------------
/spec/classes/wireless_spec.rb:
--------------------------------------------------------------------------------
1 | require 'spec_helper'
2 |
3 | describe 'archlinux_macbookretina::wireless' do
4 | let(:facts) { spec_facts }
5 |
6 | describe "installs packages" do
7 | it { should compile.with_all_deps }
8 | it { should contain_package('iw').with_ensure('present') }
9 | it { should contain_package('wpa_supplicant').with_ensure('present') }
10 | end
11 | describe 'uses broadcom-wl on MBP 10,1' do
12 | let(:facts) { spec_facts(
13 | :productname => 'MacBookPro10,1',
14 | :dmi => { 'product' => { 'name' => 'MacBookPro10,1' } },
15 | ) }
16 | it { should contain_package('broadcom-wl').with_ensure('present') }
17 | end
18 | describe 'uses kernel builtin drivers on MBP 11,4' do
19 | let(:facts) { spec_facts }
20 | it { should_not contain_package('broadcom-wl') }
21 | it { should contain_notify('using built-in kernel drivers for wireless on MacBookPro11,4') }
22 | end
23 | end
24 |
--------------------------------------------------------------------------------
/spec/spec_helper.rb:
--------------------------------------------------------------------------------
1 | # This file is generated by ModuleSync, do not edit.
2 | require 'puppetlabs_spec_helper/module_spec_helper'
3 |
4 | if Puppet::Util::Package.versioncmp(Puppet.version, '4.5.0') >= 0
5 | RSpec.configure do |c|
6 | c.before :each do
7 | Puppet.settings[:strict] = :error
8 | end
9 | end
10 | end
11 |
12 | # put local configuration and setup into spec_helper_local
13 | begin
14 | require 'spec_helper_local'
15 | rescue LoadError => loaderror
16 | puts "Could not require spec_helper_local: #{loaderror.message}"
17 | end
18 |
--------------------------------------------------------------------------------
/spec/spec_helper_acceptance.rb:
--------------------------------------------------------------------------------
1 | require 'beaker-rspec'
2 | require 'beaker/puppet_install_helper'
3 | require 'beaker/module_install_helper'
4 |
5 | RSpec.configure do |c|
6 | # Project root
7 | proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
8 |
9 | # Readable test descriptions
10 | c.formatter = :documentation
11 |
12 | # Configure all nodes in nodeset
13 | c.before :suite do
14 | # pacman update
15 | hosts.each do |h|
16 | on h, 'pacman -Syu --noconfirm' unless ENV['BEAKER_provision'] == 'no'
17 | run_puppet_install_helper unless ENV['BEAKER_provision'] == 'no'
18 | install_module_dependencies_on(h)
19 | on h, puppet('module', 'install', 'jantman-archlinux_workstation')
20 | # on ArchLinux, install_module_on(hosts) installs in /etc/puppet/modules
21 | # instead of /etc/puppetlabs/code/modules
22 | copy_module_to(h, source: proj_root, module_name: 'archlinux_macbookretina', target_module_path: '/etc/puppetlabs/code/modules')
23 | on h, 'mkdir -p /etc/facter/facts.d'
24 | scp_to(h, File.join(proj_root, 'spec', 'acceptance_test_fact_overrides.yaml'), '/etc/facter/facts.d/acceptance_test_overrides.yaml')
25 | end
26 | end
27 | end
28 |
--------------------------------------------------------------------------------
/spec/spec_helper_local.rb:
--------------------------------------------------------------------------------
1 | require 'puppet'
2 |
3 | # helper to allow easy definition of a base set of facts for all specs
4 | def spec_facts(additional = {})
5 | facts = {
6 | :osfamily => 'Archlinux',
7 | :operatingsystem => 'Archlinux',
8 | :puppetversion => Puppet::PUPPETVERSION,
9 | :virtual => 'physical',
10 | :productname => 'MacBookPro11,4',
11 | # structured facts
12 | :os => { 'family' => 'Archlinux' },
13 | :dmi => { 'product' => { 'name' => 'MacBookPro11,4' } },
14 | :disks => {
15 | 'sda' => {
16 | 'model' => "APPLE SSD SM0256",
17 | 'size' => "233.76 GiB",
18 | 'size_bytes' => 251000193024,
19 | 'vendor' => "ATA"
20 | },
21 | 'sdb' => {
22 | 'model' => "SD Card Reader",
23 | 'size' => "0 bytes",
24 | 'size_bytes' => 0,
25 | 'vendor' => "APPLE"
26 | }
27 | }
28 | }
29 | facts.merge(additional)
30 | end
31 |
--------------------------------------------------------------------------------
/templates/00-touchpad.conf.erb:
--------------------------------------------------------------------------------
1 | # managed by Puppet jantman/archlinux_macbookretina::touchpad
2 | # from: https://wiki.archlinux.org/index.php/MacBook#Keyboard_.26_Trackpad
3 | Section "InputClass"
4 | Identifier "Trackpad"
5 | Driver "synaptics"
6 | MatchIsTouchpad "on"
7 | MatchDevicePath "/dev/input/event*"
8 | EndSection
--------------------------------------------------------------------------------