CodingFuture + Puppet。 パートII:アクセスと標準環境(cfauth + cfsystem)

Puppet 4ベースのLinuxシステムの展開オプション。パートII:アクセスと標準環境(cfauth + cfsystem)


要するに:


  1. cfauth -SSHサービス、管理者アカウント、 sudo 、スーパーユーザーパスワードを設定します
  2. cfsystem-設定:APT、タイムゾーン、システムレターの送信、時間同期、標準パッケージの拡張リスト
  3. すべてのモジュールはcfnetworkネットワークフィルターモジュールと統合されており、追加の設定は不要です。


テーマサイクル:



このモジュールのペアは、展開されたほぼすべてのシステムで実行する必要がある標準アクションを自動化するために使用されます。


cfauthモジュール


目標



構成



cfsystemモジュール


このモジュールは、隔離されたシステムだけでなく、許容される発信接続を制限し、倫理的なネットワーク標準を維持するために、DMZ内で標準サービスを提供する機能にも焦点を当てています-数十のシステムのチームを外部サービスに分割しないでください。


目標



クラスcfsystem


ネストされたクラスはすべて自動的に追加されます。



クラスcfsystem::hierapool


hiera.yamlで階層を設定するのに便利なファクトのインストールとサポート。



例:


 --- :backends: - yaml :hierarchy: - "%{::trusted.domain}/%{::trusted.hostname}" - "%{::trusted.domain}" - "%{::cf_location}/%{::cf_location_pool}" - "%{::cf_location}" - common :merge_behavior: deeper :yaml: :datadir: 

パラメータ:



クラスcfsystem::email


システム通知の送信を構成します。



クラスcfsystem::sysctl



この機能はまだ完全ではなく、拡張される可能性があります。


クラスcfsystem::debian


Debian固有:



クラスcfsystem::ubuntu


Ubuntuに固有:



タイプcfsystem::debian::debconf


標準packageタイプのラッパーですが、Debian Configのイデオロギー的に正しい構成をサポートしています。



生きている例


Vagrantでのインフラストラクチャの完全な展開については、 こちらをご覧ください


ヒエラ設定


 --- classes: - cfsystem #       `cf_location`  `cf_location_pool`    # ,       cfsystem::hierapool::location: 'somelocation' cfsystem::hierapool::pool: 'somepool' cfauth::admin_user: vagrant # mkpasswd -m sha-512: 'vagrant' cfauth::admin_password: '$6$W32Psa5h$l7iIrVFdG.6SRta86n1GlDcMBapDP3fpzLD4F2Vkz2xTfd2GFg34h5CEBH3JifiVRszumAteGDLXZEbp2bx3Z0' cfauth::sudo_no_password_all: true cfauth::admin_auth_keys: data_test: key: 'AAAAB3NzaC1yc2EAAAADAQABAAAAgQDiruOsKA2xTeITRnmLlWph1xNdyoX7cufWU48737E8KQSltRZEeyyLKKPR0L+XTwrvpIhwymikP+7K77KMF8yEg9f98FaYtxGdEvPqGVO7Dezdg3eQmQzYce0/wlgLXn0GJa2TcrG7lvSnHkCjbOV5lRWP5vY92skYQHhuwtMgtQ==' options: - 'from="10.0.0.0/8,192.168.0.0/16,172.16.0.0/12"' #        IP cfauth::admin_hosts: - '10.0.0.0/8' - '192.168.0.0/16' - '172.16.0.0/12' #  APT , NTP  SMTP Smarthost    cfsystem::repo_proxy: host: maint.example.com port: 3142 cfsystem::ntp_servers: 'maint.example.com' cfsystem::email::smarthost: 'maint.example.com' #       'maint.example.com' #=================================================== cfsystem::add_repo_cacher: true cfsystem::add_ntp_server: true cfsystem::ntp_servers: - 0.debian.pool.ntp.org - 1.debian.pool.ntp.org - 2.debian.pool.ntp.org - 3.debian.pool.ntp.org cfsystem::email::smarthost: cfsystem::email::listen_ifaces: 'main' / wlgLXn0GJa2TcrG7lvSnHkCjbOV5lRWP5vY92skYQHhuwtMgtQ ==' --- classes: - cfsystem #       `cf_location`  `cf_location_pool`    # ,       cfsystem::hierapool::location: 'somelocation' cfsystem::hierapool::pool: 'somepool' cfauth::admin_user: vagrant # mkpasswd -m sha-512: 'vagrant' cfauth::admin_password: '$6$W32Psa5h$l7iIrVFdG.6SRta86n1GlDcMBapDP3fpzLD4F2Vkz2xTfd2GFg34h5CEBH3JifiVRszumAteGDLXZEbp2bx3Z0' cfauth::sudo_no_password_all: true cfauth::admin_auth_keys: data_test: key: 'AAAAB3NzaC1yc2EAAAADAQABAAAAgQDiruOsKA2xTeITRnmLlWph1xNdyoX7cufWU48737E8KQSltRZEeyyLKKPR0L+XTwrvpIhwymikP+7K77KMF8yEg9f98FaYtxGdEvPqGVO7Dezdg3eQmQzYce0/wlgLXn0GJa2TcrG7lvSnHkCjbOV5lRWP5vY92skYQHhuwtMgtQ==' options: - 'from="10.0.0.0/8,192.168.0.0/16,172.16.0.0/12"' #        IP cfauth::admin_hosts: - '10.0.0.0/8' - '192.168.0.0/16' - '172.16.0.0/12' #  APT , NTP  SMTP Smarthost    cfsystem::repo_proxy: host: maint.example.com port: 3142 cfsystem::ntp_servers: 'maint.example.com' cfsystem::email::smarthost: 'maint.example.com' #       'maint.example.com' #=================================================== cfsystem::add_repo_cacher: true cfsystem::add_ntp_server: true cfsystem::ntp_servers: - 0.debian.pool.ntp.org - 1.debian.pool.ntp.org - 2.debian.pool.ntp.org - 3.debian.pool.ntp.org cfsystem::email::smarthost: cfsystem::email::listen_ifaces: 'main' 

UPD 2016-02-18:



UPD 2016-03-12:




Source: https://habr.com/ru/post/J277309/


All Articles