Skip to content

Commit

Permalink
Merge pull request #47 from n3snah/release/v0.4.0
Browse files Browse the repository at this point in the history
Release/v0.4.0
  • Loading branch information
n3snah authored Oct 19, 2021
2 parents d411938 + 486da8d commit f09a05f
Show file tree
Hide file tree
Showing 28 changed files with 953 additions and 442 deletions.
5 changes: 3 additions & 2 deletions .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
---
fixtures:
forge_modules:
stdlib: "puppetlabs/stdlib"
registry: "puppetlabs/registry"
stdlib: 'puppetlabs/stdlib'
registry: 'puppetlabs/registry'
apt: 'puppetlabs/apt'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@
.project
.envrc
/inventory.yaml
/spec/fixtures/litmus_inventory.yaml
16 changes: 16 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,19 @@ parallel_spec-Ruby 2.5.7-Puppet ~> 6:
variables:
PUPPET_GEM_VERSION: '~> 6'

syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop-Ruby 2.7.2-Puppet ~> 7:
stage: syntax
image: ruby:2.7.2
script:
- bundle exec rake syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop
variables:
PUPPET_GEM_VERSION: '~> 7'

parallel_spec-Ruby 2.7.2-Puppet ~> 7:
stage: unit
image: ruby:2.7.2
script:
- bundle exec rake parallel_spec
variables:
PUPPET_GEM_VERSION: '~> 7'

3 changes: 3 additions & 0 deletions .pdkignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
.project
.envrc
/inventory.yaml
/spec/fixtures/litmus_inventory.yaml
/appveyor.yml
/.editorconfig
/.fixtures.yml
/Gemfile
/.gitattributes
Expand All @@ -42,3 +44,4 @@
/spec/
/.vscode/
/.sync.yml
/.devcontainer/
12 changes: 9 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,17 @@ jobs:
env: PUPPET_GEM_VERSION="~> 6.0" CHECK=parallel_spec
rvm: 2.5.7
stage: spec
#-
#env: DEPLOY_TO_FORGE=yes
#stage: deploy
-
env: DEPLOY_TO_FORGE=yes
stage: deploy
branches:
only:
- master
- /^v\d/
notifications:
email: false
deploy:
provider: puppetforge
user: "n3snah"
password:
secure: "JB1PZcRdzz2v11tRd2JnhFqol7GT2fhf/aZwHQy6HC77Bhkvm5auLvbhAChR40V3SN9KYSg+ONQMl4Wyp5dsu/5r9ys4AIZyDfD/GhfYycGifFhE31jPcdG27IGtSSRc/VCFYd4BK5gi/jL+QNtp0j1smTVDuap+xqjvl8JD1XAT+AHAxMg6xCDjMXxS5sMtHrB0KgbGlVqBRG/1ia/+kTR3f2Q0yLkHgDycLpH51SZghEqBH5YHimQJtFMsCov4IfWA4jhPycMB/3L+bF23/pkPP1bKVZ73h7ufAzy78u+H213s/dYjMJeZQM3sULXmv28cylLBbgNZPrWqC7V7xi+hmPzF+osGRQFDsS2rylYXOOzC+4UL6liL83tzjrdlBuKQ3vTMxBK6XZgklOqxUP7s1IvptnizacFLNesSyV5oZHSYanGfvQonDIDPqXqX5ZdhiSfSVpWB5tqnrChj+p/XvwL3lk58LRgFvtnmYQA2JbBEOAGFvDQfFjMilVrqnIKn4BrWZWWV81Vmsdltfbb6XqWpKXG6xzfX53lYkA6PfVRW2omJY0I7wAICK6WNhsammiRyXGOx4jvnUyBqVBLwBQCxGNLTbn1/O5Uug8yM/gQmfw7UR5+NNZiKTHVLZMFgcdL61lF0NnrBlMioadJdG6kvf1uRwZy+de3dKAY="
21 changes: 19 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,24 @@

All notable changes to this project will be documented in this file.

## Release 0.3.0
## Release 0.4.0 (2021/10/19)

**Features**
- Added: Support for installing PowerShell 7 on Ubuntu 18.04 and Ubuntu 20.04 systems.
- Added: Added information to readme to document any requirements.
- Added: Added new parameter `apt_repository` for Ubuntu PowerShell package management.
- Added: Many params in init.pp are now optional. Mainly because Linux would throw errors if they weren't defined.
- Added: Code coverage reports for RSPEC and Travis CI.
- Updated: Module has been updated to PDK v2.1.1.
- Updated: PowerShell Preview URL has been updated to 7.2.0 Preview 7
- Updated: REFERENCE.md has been regenerated via `puppet strings` to account for new changes for Ubuntu support.

**Bugfixes**
- Fix: Fixed case with `Windows Server 2012 R2` as it wasn't testing correctly.
- Fix: Added in missing Table of Contents link for `PowerShell Windows Colors`.
- Fix: Deploy stage has been set to `master` instead of `main`.

## Release 0.3.0 (2021/05/13)

**Features**
- Added: New file REFERENCE.md which is viewable on the forge.
Expand All @@ -13,7 +30,7 @@ All notable changes to this project will be documented in this file.
- Added: New Data Type Alias `Powershell7::Windowcolor` to restrict Window Background/Foreground to specific colors

**Bugfixes**
- fixed: Removed hardcoded Windows paths from powershell7::install exec resource
- Fix: Removed hardcoded Windows paths from powershell7::install exec resource

## Release 0.2.0 (2021/04/07)

Expand Down
18 changes: 18 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# CONTRIBUTING
We warmly welcome you to assist and contribute to this repository, all you need is a Github account and an associated issue registered in the repository issues register for the associated change you would like made.

## Reporting an issue/feature
Please visit https://github.com/n3snah/powershell7/issues and ensure that your issue/feature doesn't already exist. Once this has been confirmed, please click the `New Issue` button and fill out one of the appropriate templates. These templates have been created to try help provide any necessary information that would be required for a developer/contributor to understand. If there isn't an appropriate template please open a blank issue.

## Your development environment
This is a puppet module leveraging the Puppet Development Kit (PDK). Please ensure that you have at least the version of PDK referenced in the `metadata.json` or newer installed on your system along with Git and an appropriate code editor of your choice.

## Forking this repository
To get started with contributing to this module, please fork the repository to your own Github account by clicking on the fork button located in the top right hand of this git repository while viewing the `code` tab. Follow the prompts to have it forked to your account.

## Pull Request Process
Please follow the steps below when submitting your pull request.
1. Added the required code with sufficent rspec tests for unit testing.
1. Updated the CHANGELOG.md & README.md to reflect the changes you have made.
1. Ensure you have successfully run `pdk validate` and `PDK test unit` with no received errors.
1. Create a pull request from your fork back to this repository's "development" branch.
13 changes: 3 additions & 10 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,6 @@ gems['puppet'] = location_for(puppet_version)
gems['facter'] = location_for(facter_version) if facter_version
gems['hiera'] = location_for(hiera_version) if hiera_version

if Gem.win_platform? && puppet_version =~ %r{^(file:///|git://)}
# If we're using a Puppet gem on Windows which handles its own win32-xxx gem
# dependencies (>= 3.5.0), set the maximum versions (see PUP-6445).
gems['win32-dir'] = ['<= 0.4.9', require: false]
gems['win32-eventlog'] = ['<= 0.6.5', require: false]
gems['win32-process'] = ['<= 0.7.5', require: false]
gems['win32-security'] = ['<= 0.2.5', require: false]
gems['win32-service'] = ['0.8.8', require: false]
end

gems.each do |gem_name, gem_params|
gem gem_name, *gem_params
end
Expand All @@ -70,3 +60,6 @@ extra_gemfiles.each do |gemfile|
end
end
# vim: syntax=ruby

# Code Coverage Reports
gem 'coveralls', require: false
33 changes: 30 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
# powershell7
[![Build Status](https://travis-ci.com/n3snah/powershell7.svg?branch=master)](https://travis-ci.com/n3snah/powershell7)
[![Coverage Status](https://coveralls.io/repos/github/n3snah/powershell7/badge.svg?branch=master)](https://coveralls.io/github/n3snah/powershell7?branch=master)

This module has been developed to manage the installation of PowerShell 7.

## Table of Contents

1. [Description](#description)
1. [Setup - The basics of getting started with powershell7](#setup)
* [Software Prerequisites](#software-prerequisites)
* [Beginning with powershell7](#beginning-with-powershell7)
1. [Usage - Configuration options and additional functionality](#usage)
* [Install and Enable PowerShell 7](#install-and-enable-powershell-7)
* [Disable Context Menu Options](#disable-context-menu-options)
* [Disable PS Remoting](#disable-ps-remoting)
* [Change Update Notification Settings](#change-update-notification-settings)
* [Configuring PowerShell Window Settings](#configuring-powerShell-window-settings)
* [PowerShell Windows Colors](#powershell-window-colors)
* [PowerShell release types](#powershell-release-types)
1. [Limitations - OS compatibility, etc.](#limitations)
1. [Development - Guide for contributing to the module](#development)

Expand All @@ -24,11 +28,20 @@ version of PowerShell brings many new features, cmdlets and includes a number of
bugfixes.

## Setup
### Software Prerequisites
On Ubuntu, this module assumes that you have the following sofware is either already
installed or in a manifest to install as this will attempt to download files from
HTTPS:
1. apt-transport-https
1. software-properties-common

Please refer to the `metadata.json` file for a list of required modules and their
supported versions.

### Beginning with powershell7

`include powershell7` is enough to get started and have PowerShell 7 installed on
your windows server.
your Windows or Linux system.

## Usage

Expand Down Expand Up @@ -64,6 +77,7 @@ class { 'powershell7':
'powershell_updatecheck' => 'LTS',
}
```
***This won't affect Linux installs at this time.***

### Configuring PowerShell Window Settings
Default PowerShell 7 window behaviour can now be customized which includes changing the size of the
Expand Down Expand Up @@ -98,10 +112,23 @@ PowerShell 7 only allows certain colors for the background and the foreground. T
* Yellow
* White

### PowerShell release types
There are 3 versions of powershell which can be installed onto any system.
1. lts - Long Term Support which is aimed at consumers who which to have very stable and long supported releases
1. preview - which is aimed at the more bleeding-edge type releases. Not usually ideal for enterprises.
1. stable - releases where they bring in new features more often than LTS but deemed more stable than preview.

```
class { 'powershell7':
'release_type => 'lts'
}
```

## Limitations

Currently this has only been designed and tested for Windows. PowerShell 7 on
Linux is not yet supported in this module.
Currently if you have PowerShell installed on Ubuntu and you decide to change the release type. Puppet is unable to uninstall
the current package and install the new package. If you run a `apt-remove <packagename>` puppets next run should succeed. A
future task will be made available to handle this.

Due to using the Stdlib::Absolutepath and the way that the code is structured. You cannot have `download_dir` set to `C:\`.
This would cause the path to end up something like `C:\\file.msi` which wouldn't be a valid windows path.
Expand Down
127 changes: 77 additions & 50 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
#### Private Classes

* `powershell7::config`: Configuration options for Powershell 7 once installed
* `powershell7::install`: Install Powershell 7
* `powershell7::install`: Install PowerShell 7
* `powershell7::install::ubuntu`: Install PowerShell 7 on Ubuntu systems
* `powershell7::install::windows`: Install Powershell 7 on Windows systems

### Data types

Expand Down Expand Up @@ -63,13 +65,6 @@ class {
The following parameters are available in the `powershell7` class:

* [`os_letter`](#os_letter)
* [`download_dir`](#download_dir)
* [`lts_file_name`](#lts_file_name)
* [`lts_source_url`](#lts_source_url)
* [`stable_file_name`](#stable_file_name)
* [`stable_source_url`](#stable_source_url)
* [`preview_file_name`](#preview_file_name)
* [`preview_source_url`](#preview_source_url)
* [`release_type`](#release_type)
* [`add_explorer_context_menu_openpowershell`](#add_explorer_context_menu_openpowershell)
* [`add_file_context_menu_runpowershell`](#add_file_context_menu_runpowershell)
Expand All @@ -81,54 +76,22 @@ The following parameters are available in the `powershell7` class:
* [`config_buffer_height`](#config_buffer_height)
* [`config_background_color`](#config_background_color)
* [`config_foreground_color`](#config_foreground_color)
* [`apt_repository`](#apt_repository)
* [`download_dir`](#download_dir)
* [`lts_file_name`](#lts_file_name)
* [`lts_source_url`](#lts_source_url)
* [`stable_file_name`](#stable_file_name)
* [`stable_source_url`](#stable_source_url)
* [`preview_file_name`](#preview_file_name)
* [`preview_source_url`](#preview_source_url)

##### <a name="os_letter"></a>`os_letter`

Data type: `Pattern[/^[A-Z]$/]`
Data type: `Optional[Pattern[/^[A-Z]$/]]`

The Letter of the disk which has the Windows folder. Defaults to C

##### <a name="download_dir"></a>`download_dir`

Data type: `Stdlib::Absolutepath`

The directory where the downloaded installer is placed.

##### <a name="lts_file_name"></a>`lts_file_name`

Data type: `String`

The name of the LTS PowerShell installer

##### <a name="lts_source_url"></a>`lts_source_url`

Data type: `Stdlib::HTTPUrl`

The internet URL for the LTS Powershell Download

##### <a name="stable_file_name"></a>`stable_file_name`

Data type: `String`

The name of the Stable PowerShell installer

##### <a name="stable_source_url"></a>`stable_source_url`

Data type: `Stdlib::HTTPUrl`

The internet URL for the Stable Powershell Download

##### <a name="preview_file_name"></a>`preview_file_name`

Data type: `String`

The name of the Preview PowerShell installer

##### <a name="preview_source_url"></a>`preview_source_url`

Data type: `Stdlib::HTTPUrl`

The internet URL for the Preview Powershell Download
Default value: ``undef``

##### <a name="release_type"></a>`release_type`

Expand Down Expand Up @@ -196,6 +159,70 @@ Data type: `Powershell7::Windowcolor`

Sets the color of the foreground text color. Defaults to 'White'

##### <a name="apt_repository"></a>`apt_repository`

Data type: `Optional[Stdlib::HTTPUrl]`

Sets the Apt Repository location for downloading PowerShell on Linux. Defaults to official Microsoft repository

Default value: ``undef``

##### <a name="download_dir"></a>`download_dir`

Data type: `Optional[Stdlib::Absolutepath]`

The directory where the downloaded installer is placed.

Default value: ``undef``

##### <a name="lts_file_name"></a>`lts_file_name`

Data type: `Optional[String]`

The name of the LTS PowerShell installer

Default value: ``undef``

##### <a name="lts_source_url"></a>`lts_source_url`

Data type: `Optional[Stdlib::HTTPUrl]`

The internet URL for the LTS Powershell Download

Default value: ``undef``

##### <a name="stable_file_name"></a>`stable_file_name`

Data type: `Optional[String]`

The name of the Stable PowerShell installer

Default value: ``undef``

##### <a name="stable_source_url"></a>`stable_source_url`

Data type: `Optional[Stdlib::HTTPUrl]`

The internet URL for the Stable Powershell Download

Default value: ``undef``

##### <a name="preview_file_name"></a>`preview_file_name`

Data type: `Optional[String]`

The name of the Preview PowerShell installer

Default value: ``undef``

##### <a name="preview_source_url"></a>`preview_source_url`

Data type: `Optional[Stdlib::HTTPUrl]`

The internet URL for the Preview Powershell Download

Default value: ``undef``

## Data types

### <a name="powershell7windowcolor"></a>`Powershell7::Windowcolor`
Expand Down
1 change: 1 addition & 0 deletions data/os/Ubuntu.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
---
2 changes: 2 additions & 0 deletions data/os/Ubuntu/18.04.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
powershell7::apt_repository: 'https://packages.microsoft.com/ubuntu/18.04/prod'
2 changes: 2 additions & 0 deletions data/os/Ubuntu/20.04.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
powershell7::apt_repository: 'https://packages.microsoft.com/ubuntu/20.04/prod'
Loading

0 comments on commit f09a05f

Please sign in to comment.