📜 ⬆️ ⬇️

CodingFuture + Puppet. Part II: Access and Standard Environment (cfauth + cfsystem)

Deployment Option for Linux Systems Based on Puppet 4. Part II: Access and Standard Environment (cfauth + cfsystem)


In short:


  1. cfauth - configures SSH service, admin account, sudo , superuser password
  2. cfsystem - configuration: APT, time zone, system mail, time synchronization, extended list of standard packages
  3. All modules are integrated with the cfnetwork network filter module and do not require additional settings.


Thematic cycle:



This pair of modules serves to automate standard actions that need to be carried out on virtually any deployed system.


cfauth module


goals



configuration



cfsystem module


This module is focused not only on separate systems, but also on the ability to provide standard services within the DMZ in order to limit admissible outgoing connections and maintain ethical network standards - do not break a team of dozens of systems into external services.


goals



cfsystem class


All nested classes are added automatically.



class cfsystem::hierapool


Installing and maintaining facts that are handy for setting up a hierarchy in hiera.yaml.



Example:


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

Options:



class cfsystem::email


Configure sending system notifications.



class cfsystem::sysctl



This functionality is not yet complete and is likely to expand.


class cfsystem::debian


Specific to Debian:



class cfsystem::ubuntu


Specific to Ubuntu:



type cfsystem::debian::debconf


A wrapper around the standard package type, but with support for ideologically correct Debian Config configuration.



Living example


The full deployment of infrastructure in Vagrant can be found here .


Hiera settings


 --- 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/277309/


All Articles