0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Puppet 6をCentOS8で動かす

Last updated at Posted at 2019-11-08

参考

インストール

# puppet6のリポジトリ追加
yum install -y \
  "https://yum.puppet.com/puppet6-release-el-8.noarch.rpm"

# パッケージのインストール
yum install -y \
  puppetserver puppet-agent

# メモリ使用量を256mbに抑える
sed -i -e 's/2g/256m/g' /etc/sysconfig/puppetserver

初期設定

/etc/puppetlabs/puppet/puppet.conf
+ [master]
+ dns_alt_names = puppetserver.local
puppetserver ca setup
puppetserver start
/etc/puppetlabs/puppet/puppet.conf
+ [main]
+ certname = puppetclient1.local
+ server = puppetserver.local
puppet resource service puppet ensure=running enable=true
puppetserver ca list --all
puppetserver ca sign --certname puppetclient1.local

実行

# dry-run
puppet agent --test --noop

# 実際に実行
puppet agent --test

ルール記述

/etc/puppetlabs/code/environments/production/manifests/site.pp
node 'puppetclient1.local' {
     file { '/tmp/puppetdir':
	     ensure => 'directory',
	     owner => 'root',
	     group => 'root',
	     mode => '0755',
	  }
}
# dry-run
puppet agent --test --noop

# 実際に実行
puppet agent --test

Dockerfile

Dockerfile 
FROM centos:8

# タイムゾーン
RUN cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime

# packages
RUN yum install -y \
 "https://yum.puppet.com/puppet6-release-el-8.noarch.rpm"

RUN yum install -y \
 puppetserver puppet-agent

RUN yum install -y \
 epel-release
RUN yum install -y \
 screen

RUN sed -i -e 's/2g/256m/g' /etc/sysconfig/puppetserver
docker run --rm \
 --hostname puppetserver.local \
 -it $IMAGE \
 /bin/bash
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?