Showing with 144 additions and 22 deletions.
  1. +8 −2 .travis.yml
  2. +11 −0 CHANGELOG.md
  3. +6 −13 README.md
  4. +8 −3 lib/puppet/type/yumrepo.rb
  5. +34 −0 locales/ja/puppetlabs-yumrepo_core.po
  6. +3 −3 metadata.json
  7. +66 −0 readmes/README_ja_JP.md
  8. +8 −1 spec/lib/puppet_spec/compiler.rb
10 changes: 8 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,23 @@ script:
- 'bundle exec rake $CHECK'
bundler_args: --without system_tests
rvm:
- 2.4.1
- 2.5.3
env:
global:
- BEAKER_PUPPET_COLLECTION=puppet6 PUPPET_GEM_VERSION="git://github.com/puppetlabs/puppet#master"
- PUPPET_GEM_VERSION="~> 6.0"
matrix:
fast_finish: true
include:
-
env: CHECK="syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop"
-
env: CHECK=parallel_spec
-
env: PUPPET_GEM_VERSION="~> 5.0" CHECK=parallel_spec
rvm: 2.4.5
-
env: PUPPET_GEM_VERSION="~> 4.0" CHECK=parallel_spec
rvm: 2.1.9
branches:
only:
- master
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org).

## [1.0.2] - 2018-11-29
### Added
- Added Japanese translation of README.md
- Added Japanese translations of localized strings
### Changed
- Travis is now testing against puppet4, puppet5, and puppet6
- Metadata updated to reflect a wider range of puppet versions this module does work with
### Fixed
- (MODULES-8114) Use old way of defining sensitive params

## [1.0.1] - 2018-08-17
### Added
- (PUP-9053) Enable localization
Expand All @@ -14,5 +24,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
### Summary
This is the initial release of the extracted yumrepo module

[1.0.2]: https://github.com/puppetlabs/puppetlabs-yumrepo_core/compare/1.0.1...1.0.2
[1.0.1]: https://github.com/puppetlabs/puppetlabs-yumrepo_core/compare/1.0.0...1.0.1
[1.0.0]: https://github.com/puppetlabs/puppetlabs-yumrepo_core/releases/tag/1.0.0
19 changes: 6 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,17 @@
#### Table of Contents

1. [Description](#description)
2. [Setup - The basics of getting started with yumrepo_core](#setup)
* [Beginning with yumrepo_core](#beginning-with-yumrepo_core)
3. [Usage - Configuration options and additional functionality](#usage)
2. [Usage - Configuration options and additional functionality](#usage)
3. [Reference - An under-the-hood peek at what the module is doing and how](#reference)
4. [Development - Guide for contributing to the module](#development)

## Description

The yumrepo_core module is used to manage client yum repo configurations by parsing INI configuration files.

## Setup

### Beginning with yumrepo_core
## Usage

To manage a yum repo for Puppet Labs Products, while using a local mirror:
To manage a yum repo for Puppet Labs Products while using a local mirror, use the following code:

```
yumrepo { 'puppetrepo-products':
Expand All @@ -33,19 +30,15 @@ yumrepo { 'puppetrepo-products':
```

## Usage

For details on usage, please see [the yumrepo puppet docs](https://puppet.com/docs/puppet/latest/types/yumrepo.html).

## Reference

Please see REFERENCE.md for the reference documentation.
Please see [`REFERENCE.md`](REFERENCE.md) for the reference documentation.

This module is documented using Puppet Strings.

For a quick primer on how Strings works, please see [this blog post](https://puppet.com/blog/using-puppet-strings-generate-great-documentation-puppet-modules) or the [README.md](https://github.com/puppetlabs/puppet-strings/blob/master/README.md) for Puppet Strings.

To generate documentation locally, run
To generate documentation locally, run the following command:
```
bundle install
bundle exec puppet strings generate ./lib/**/*.rb
Expand Down
11 changes: 8 additions & 3 deletions lib/puppet/type/yumrepo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,6 @@
desc "Password for this proxy. #{ABSENT_DOC}"

newvalues(%r{.*}, :absent)

sensitive true
end

newproperty(:s3_enabled) do
Expand Down Expand Up @@ -423,6 +421,13 @@
desc "Password to use with the username for basic authentication.
#{ABSENT_DOC}"
newvalues(%r{.*}, :absent)
sensitive true
end

private

def set_sensitive_parameters(sensitive_parameters) # rubocop:disable Style/AccessorMethodName
parameter(:password).sensitive = true if parameter(:password)
parameter(:proxy_password).sensitive = true if parameter(:proxy_password)
super(sensitive_parameters)
end
end
34 changes: 34 additions & 0 deletions locales/ja/puppetlabs-yumrepo_core.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2018 Puppet, Inc.
# This file is distributed under the same license as the puppetlabs-yumrepo_core package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2018.
#
# Translators:
# Erwin Hom <erwin.hom@puppet.com>, 2018
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: puppetlabs-yumrepo_core 1.0.0-2-g305863b\n"
"\n"
"Report-Msgid-Bugs-To: docs@puppet.com\n"
"POT-Creation-Date: 2018-08-17 15:26-0700\n"
"PO-Revision-Date: 2018-10-24 00:55+0000\n"
"Last-Translator: Erwin Hom <erwin.hom@puppet.com>, 2018\n"
"Language-Team: Japanese (Japan) (https://www.transifex.com/puppet/teams/41915/ja_JP/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: ja_JP\n"
"Plural-Forms: nplurals=1; plural=0;\n"

#: ../lib/puppet/provider/yumrepo/inifile.rb:185
msgid "changing mode of %{file} from %{current_mode} to %{target_mode}"
msgstr "%{file}のモードを%{current_mode}から%{target_mode}に変更しています。"

#: ../lib/puppet/type/yumrepo.rb:65 ../lib/puppet/type/yumrepo.rb:81
#: ../lib/puppet/type/yumrepo.rb:136 ../lib/puppet/type/yumrepo.rb:160
#: ../lib/puppet/type/yumrepo.rb:183 ../lib/puppet/type/yumrepo.rb:307
#: ../lib/puppet/type/yumrepo.rb:375
msgid "Must be a valid URL"
msgstr "有効なURLにする必要があります。"
6 changes: 3 additions & 3 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "puppetlabs-yumrepo_core",
"version": "1.0.1",
"version": "1.0.2",
"author": "Puppet Labs",
"summary": "Manage client yum repo configurations by parsing yum INI configuration files.",
"license": "Apache-2.0",
"source": "https://github.com/puppetlabs/puppetlabs-yumrepo_core",
"project_page": "https://github.com/puppetlabs/puppetlabs-yumrepo_core/blob/master/README.md",
"project_page": "https://github.com/puppetlabs/puppetlabs-yumrepo_core",
"issues_url": "https://tickets.puppetlabs.com/projects/MODULES",
"dependencies": [

Expand Down Expand Up @@ -55,7 +55,7 @@
"requirements": [
{
"name": "puppet",
"version_requirement": ">= 6.0.0 < 7.0.0"
"version_requirement": ">= 4.7.0 < 7.0.0"
}
],
"pdk-version": "1.6.0",
Expand Down
66 changes: 66 additions & 0 deletions readmes/README_ja_JP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@

# yumrepo_core

#### 目次

1. [説明](#description)
2. [セットアップ - yumrepo_coreモジュール導入の基本](#setup)
* [yumrepo_coreモジュールの利用方法](#beginning-with-yumrepo)
3. [使用 - 設定オプションと追加機能](#usage)
4. [開発 - モジュール貢献についてのガイド](#development)

<a id="description"></a>
## 説明

yumrepo_coreモジュールは、INI設定ファイルの構文解析によるクライアントのyumリポジトリ設定の管理に使用されます。

<a id="setup"></a>
## セットアップ

<a id="beginning-with-yumrepo"></a>
### yumrepo_coreモジュールの利用方法

ローカルミラー使用時にPuppet Labs製品のyumリポジトリを管理するには、以下のコードを使用します。

```
yumrepo { 'puppetrepo-products':
ensure => 'present',
name => 'puppetrepo-products',
descr => 'Puppet Labs Products El 7 - $basearch',
baseurl => 'http://myownmirror',
gpgkey => 'http://myownmirror',
enabled => '1',
gpgcheck => '1',
target => '/etc/yum.repo.d/puppetlabs.repo',
}
```

<a id="usage"></a>
## 使用

利用方法の詳細については、[yumrepo puppetドキュメント](https://puppet.com/docs/puppet/latest/types/yumrepo.html)を参照してください。

## リファレンス

リファレンス文書については、REFERENCE.mdを参照してください。

このモジュールは、Puppet Stringsを用いて文書化されています。

Stringsの仕組みの簡単な概要については、Puppet Stringsに関する[こちらのブログ記事](https://puppet.com/blog/using-puppet-strings-generate-great-documentation-puppet-modules)または[README.md](https://github.com/puppetlabs/puppet-strings/blob/master/README.md)を参照してください。

文書をローカルで作成するには、以下のコマンドを実行します。
```
bundle install
bundle exec puppet strings generate ./lib/**/*.rb
```
このコマンドにより、閲覧可能な`_index.html`ファイルが`doc`ディレクトリに作成されます。ここで利用可能なリファレンスはすべて、コードベースに埋め込まれたYARD形式のコメントから生成されます。このモジュールに関して何らかの開発をする場合は、影響を受ける文書も更新する必要があります。

<a id="development"></a>
## 開発

Puppet ForgeのPuppet Labsモジュールは、オープンプロジェクトです。プロジェクトをさらに発展させるには、コミュニティへの貢献が不可欠です。Puppetが役立つ可能性のある膨大な数のプラットフォーム、無数のハードウェア、ソフトウェア、デプロイメント構成に我々がアクセスすることはできません。

弊社は、できるだけ変更に貢献しやすくして、弊社のモジュールがユーザの環境で機能する状態を維持したいと考えています。弊社では、状況を把握できるよう、貢献者に従っていただくべきいくつかのガイドラインを設けています。

詳細については、[モジュール貢献ガイド](https://docs.puppetlabs.com/forge/contributing.html)を参照してください。
9 changes: 8 additions & 1 deletion spec/lib/puppet_spec/compiler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,19 @@ def compile_to_ral(manifest, node = Puppet::Node.new('test'))
end

def apply_compiled_manifest(manifest, prioritizer = Puppet::Graph::SequentialPrioritizer.new)
args = []
if Puppet.version.to_f < 5.0
args << 'apply'
# rubocop:disable RSpec/AnyInstance
Puppet::Transaction::Persistence.any_instance.stubs(:save)
# rubocop:enable RSpec/AnyInstance
end
catalog = compile_to_ral(manifest)
if block_given?
catalog.resources.each { |res| yield res }
end
transaction = Puppet::Transaction.new(catalog,
Puppet::Transaction::Report.new,
Puppet::Transaction::Report.new(*args),
prioritizer)
transaction.evaluate
transaction.report.finalize_report
Expand Down