Advertisement
Guest User

Untitled

a guest
Oct 3rd, 2017
640
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 20.17 KB | None | 0 0
  1. foreman:
  2.   auth:
  3.     url: {{ foreman_yml_api_url }}
  4.     user: {{ foreman_yml_api_username }}
  5.     pass: {{ foreman_yml_api_password }}
  6.   auth-source-ldap:
  7.     - name: default
  8.       host: {{ openldap_server_domain_name }}
  9.       port: 389
  10.       account: cn=Manager,{{ openldap_server_dc }}
  11.       account-password: {{ vault_openldap_server_rootpw }}
  12.       base-dn: {{ openldap_server_dc }}
  13.       attr-login: uid
  14.       attr-firstname: givenName
  15.       attr-lastname: sn
  16.       attr-mail: mail
  17.       attr-photo:
  18.       onthefly-register: true
  19.       usergroup-sync: true
  20.       tls: false
  21.       groups-base: ou=groups,{{ openldap_server_dc }}
  22.       ldap-filter:
  23.       server-type: posix
  24.   usergroups:
  25.     - name: ldap-admin
  26.       admin: true
  27.       users:
  28.       groups:
  29.         - name: ldap-admin
  30.       ext-usergroups:
  31.         - name: admin
  32.           auth-source-ldap: default
  33.       roles:
  34.         - name: admin
  35.  
  36.   setting:
  37.     - name: safemode_render
  38.       value: false
  39.     - name: token_duration
  40.       value: 1800
  41.     - name: access_unattended_without_build
  42.       value: true
  43.     - name: update_ip_from_built_request
  44.       value: true
  45.     - name: use_shortname_for_vms
  46.       value: true
  47.     - name: trusted_puppetmaster_hosts
  48.       value: "[{{ ansible_default_ipv4.address }}, 127.0.0.1]"
  49.     #- name: remote_execution_ssh_user
  50.     #  value: root
  51.     #- name: remote_execution_ssh_key
  52.     #  value: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDN318oRd1xXDF5N+1wJNlN9Z7ncTck6qTiG5W0VLmZqLpQP/EHXbWEz4YWbyQrUv4yZegVTTbfKGYhj2aqsDQVov0E/vfASriI/pT3Mu20Z2yG17FOH39zWre16jmPMQkTNaUMGXIFsQW58Sn6Pyo9j81VBjgzNdaw1fvx1sSIBM6SIqXlEm185L3vf0e0miKpK1abNQhqorSV5rfIHS6hqKQIH5Uq6wa/fhMpQ+DtoE7xJj0m2A65SC51yTaDrbqHDhAK+1q87nU7JYhUcVC+CxJ25hmVBo1H6RVhHohZG/+9YNWgNT8sHJbNsS9jL+OME184/tfBMtm0XjlbzU1v root@astrotrain
  53.  
  54.   smart-proxy:
  55.     - name: Smart Proxy
  56.       url: "http://{{ ansible_default_ipv4.address }}:8000"
  57.  
  58.   domain:
  59.     - name: {{ ansible_domain }}
  60.       fullname:
  61.       dns-proxy:
  62.       parameters:
  63.   subnet:
  64.     - name: default
  65.       network: {{ ansible_default_ipv4.network }}
  66.       mask: {{ ansible_default_ipv4.netmask }}
  67.       gateway: {{ ansible_default_ipv4.gateway }}
  68.       dns-primary: {{ ansible_dns.nameservers[0] | to_json }}
  69.       dns-secondary:
  70.       from:
  71.       to:
  72.       ipam: None
  73.       vlanid: 10
  74.       domain:
  75.         - name: {{ ansible_domain }}
  76.       dhcp-proxy:
  77.       tftp-proxy: Smart Proxy
  78.       dns-proxy:
  79.       boot-mode: DHCP
  80.  
  81.   cleanup-architecture:
  82.     - name: i386
  83.  
  84.   cleanup-medium:
  85.     - name: CentOS mirror
  86.     - name: CoreOS mirror
  87.     - name: Debian mirror
  88.     - name: Fedora mirror
  89.     - name: FreeBSD mirror
  90.     - name: OpenSUSE mirror
  91.     - name: Ubuntu mirror
  92.  
  93.   cleanup-partition-table:
  94.     - name: AutoYaST entire SCSI disk
  95.     - name: AutoYaST entire virtual disk
  96.     - name: AutoYaST LVM
  97.     - name: CoreOS default fake
  98.     - name: FreeBSD
  99.     - name: Jumpstart default
  100.     - name: Jumpstart mirrored
  101.     - name: Junos default fake
  102.     - name: Kickstart default
  103.     - name: Preseed default
  104.     - name: Preseed custom LVM
  105.  
  106.   architecture:
  107.     - name: x86_64
  108.  
  109.   medium:
  110.     - name: Ubuntu Mirror
  111.       path: "http://archive.ubuntu.com/ubuntu"
  112.       os-family: Debian
  113.  
  114.   partition-table:
  115.     - name: Ubuntu Default
  116.       layout: |
  117.              <%#
  118.               kind: ptable
  119.               name: Preseed default LVM
  120.               oses:
  121.               - Debian
  122.               - Ubuntu
  123.               %>
  124.               <%
  125.                 partitioning_method = @host.params['partitioning-method'] ? @host.params['partitioning-method'] : 'lvm'
  126.                 partitioning_recipe = @host.params['partitioning-recipe'] ? @host.params['partitioning-recipe'] : 'multi'
  127.                 partitioning_expert_recipe = @host.params['partitioning-expert-recipe'] ? @host.params['partitioning-expert-recipe'] : ''
  128.                 vg_name = @host.params['partitioning-vg-name'] ? @host.params['partitioning-vg-name'] : 'vg00'
  129.                 partitioning_filesystem = @host.params['partitioning-filesystem'] ? @host.params['partitioning-filesystem'] : ''
  130.               -%>
  131.  
  132.               <% if @host.params['install-disk'] -%>
  133.               d-i partman-auto/disk string <%= @host.params['install-disk'] %>
  134.               <% else -%>
  135.               # Use the first detected hard disk as default installation disk
  136.               d-i partman/early_command string debconf-set partman-auto/disk "$(list-devices disk | head -n1)"
  137.               <% end -%>
  138.  
  139.               ### Partitioning
  140.               # The presently available methods are: "regular", "lvm" and "crypto"
  141.               d-i partman-auto/method string <%= partitioning_method %>
  142.  
  143.               # If one of the disks that are going to be automatically partitioned
  144.               # contains an old LVM configuration, the user will normally receive a
  145.               # warning. This can be preseeded away...
  146.               d-i partman-lvm/device_remove_lvm boolean true
  147.               # The same applies to pre-existing software RAID array:
  148.               d-i partman-md/device_remove_md boolean true
  149.               # And the same goes for the confirmation to write the lvm partitions.
  150.               d-i partman-lvm/confirm boolean true
  151.               d-i partman-lvm/confirm_nooverwrite boolean true
  152.  
  153.               <% if partitioning_method == 'lvm' -%>
  154.               # For LVM partitioning, you can select how much of the volume group to use
  155.               # for logical volumes.
  156.               d-i partman-auto-lvm/guided_size string max
  157.               <% if vg_name != '' -%>
  158.               d-i partman-auto-lvm/new_vg_name string <%= vg_name %>
  159.               <% end -%>
  160.               <% end -%>
  161.  
  162.               # You can choose one of the three predefined partitioning recipes:
  163.               # - atomic: all files in one partition
  164.               # - home:   separate /home partition
  165.               # - multi:  separate /home, /var, and /tmp partitions (/usr was removed in jessie)
  166.               d-i partman-auto/choose_recipe select <%= partitioning_recipe %>
  167.  
  168.               <% if partitioning_expert_recipe != '' -%>
  169.               # Or provide a recipe of your own...
  170.               # If you have a way to get a recipe file into the d-i environment, you can
  171.               # just point at it.
  172.               d-i partman-auto/expert_recipe string \
  173.               <%= partitioning_expert_recipe.gsub(/$/, " \\") %>
  174.  
  175.               <% end -%>
  176.  
  177.               # If you just want to change the default filesystem to something
  178.               # else, you can do that without providing a full recipe.
  179.               <% if partitioning_filesystem != '' -%>
  180.               d-i partman/default_filesystem string <%= partitioning_filesystem %>
  181.               <% end -%>
  182.  
  183.               # This makes partman automatically partition without confirmation, provided
  184.               # that you told it what to do using one of the methods above.
  185.               d-i partman/confirm_write_new_label boolean true
  186.               d-i partman/choose_partition select finish
  187.               d-i partman/confirm boolean true
  188.               d-i partman/confirm_nooverwrite boolean true
  189.  
  190.       snippet: false
  191.       audit-comment: initial import
  192.       locked: false
  193.       os-family: Debian
  194.  
  195.   provisioning-template:
  196.     - name: Ubuntu PXE
  197.       template: |
  198.                <%#
  199.                 kind: PXELinux
  200.                 name: Preseed default PXELinux
  201.                 oses:
  202.                 - Debian
  203.                 - Ubuntu
  204.                 %>
  205.                 #
  206.                 # This file was deployed via '<%= template_name %>' template
  207.                 #
  208.                 # Supported host/hostgroup parameters:
  209.                 #
  210.                 # blacklist = module1, module2
  211.                 #   Blacklisted kernel modules
  212.                 #
  213.                 # lang = en_US
  214.                 #   System locale
  215.                 #
  216.                 <%
  217.                   options = []
  218.                   if @host.params['blacklist']
  219.                     options << @host.params['blacklist'].split(',').collect{|x| "#{x.strip}.blacklist=yes"}.join(' ')
  220.                   end
  221.                   if @host.operatingsystem.name == 'Debian'
  222.                     options << "auto=true"
  223.                     options << "domain=#{@host.domain}"
  224.                   else
  225.                     options << 'console-setup/ask_detect=false console-setup/layout=USA console-setup/variant=USA keyboard-configuration/layoutcode=us localechooser/translation/warn-light=true localechooser/translation/warn-severe=true'
  226.                   end
  227.                   options << "locale=#{@host.params['lang'] || 'en_US'}"
  228.                   options = options.join(' ')
  229.                 -%>
  230.  
  231.                 DEFAULT linux
  232.  
  233.                 LABEL linux
  234.                     KERNEL <%= @kernel %>
  235.                     APPEND initrd=<%= @initrd %> interface=auto url=<%= foreman_url('provision')%> ramdisk_size=10800 root=/dev/rd/0 rw auto hostname=<%= @host.name %> <%= options %>
  236.                     IPAPPEND 2
  237.       snippet: false
  238.       audit-comment: initial import
  239.       template-kind-id: 1
  240.       template-combination-attribute:
  241.         - hostgroup:
  242.           environment:
  243.       os:
  244.         - name: Ubuntu 16.04 LTS
  245.       locked: false
  246.  
  247.     - name: Ubuntu Preseed
  248.       template: |
  249.                <%#
  250.                 kind: provision
  251.                 name: Ubuntu Preseed
  252.                 oses:
  253.                 - Debian
  254.                 - Ubuntu
  255.                 %>
  256.                 <%
  257.                   proxy_string = @host.params['http-proxy'] ? " http://#{@host.params['http-proxy']}:#{@host.params['http-proxy-port']}" : ''
  258.                   salt_enabled = @host.params['salt_master'] ? true : false
  259.                   os_major = @host.operatingsystem.major.to_i
  260.                   squeeze_or_older = (@host.operatingsystem.name == 'Debian' && os_major <= 6)
  261.                 %>
  262.                 # Locale
  263.                 d-i debian-installer/locale string <%= @host.params['lang'] || 'en_US' %>
  264.                 # country and keyboard settings are automatic. Keep them ...
  265.                 # ... for wheezy and newer:
  266.                 d-i keyboard-configuration/xkb-keymap seen true
  267.                 <% if squeeze_or_older -%>
  268.                 # ... for squeeze and older:
  269.                 d-i console-keymaps-at/keymap seen true
  270.                 <% end -%>
  271.  
  272.                 <% subnet = @host.subnet -%>
  273.                 <% if subnet.respond_to?(:dhcp_boot_mode?) -%>
  274.                   <% dhcp = subnet.dhcp_boot_mode? && !@static -%>
  275.                 <% else -%>
  276.                   <% dhcp = !@static -%>
  277.                 <% end -%>
  278.                 <% unless dhcp -%>
  279.                 # Static network configuration.
  280.                 d-i preseed/early_command string /bin/killall.sh; /bin/netcfg
  281.                 d-i netcfg/disable_autoconfig boolean true
  282.                 d-i netcfg/dhcp_failed note
  283.                 d-i netcfg/dhcp_options select Configure network manually
  284.                 d-i netcfg/disable_dhcp boolean true
  285.                 d-i netcfg/get_ipaddress string <%= @host.ip %>
  286.                 d-i netcfg/get_netmask string <%= subnet.mask %>
  287.                 d-i netcfg/get_nameservers string <%= [subnet.dns_primary,subnet.dns_secondary].reject{|n| n.blank?}.join(' ') %>
  288.                 d-i netcfg/get_gateway string <%= subnet.gateway %>
  289.                 d-i netcfg/confirm_static boolean true
  290.                 <% end -%>
  291.  
  292.                 # Network configuration
  293.                 d-i netcfg/choose_interface select auto
  294.                 d-i netcfg/get_hostname string <%= @host %>
  295.                 d-i netcfg/get_domain string <%= @host.domain %>
  296.                 d-i netcfg/wireless_wep string
  297.  
  298.                 d-i hw-detect/load_firmware boolean true
  299.  
  300.                 <% if @host.param_true?('preseed-live-installer') -%>
  301.                 # Offline live-installer location
  302.                 d-i live-installer/net-image string http://<%= @preseed_server %><%= @preseed_path %>/install/filesystem.squashfs
  303.                 <% end -%>
  304.  
  305.                 # Mirror settings
  306.                 d-i mirror/country string manual
  307.                 d-i mirror/http/hostname string <%= @preseed_server %>
  308.                 d-i mirror/http/directory string <%= @preseed_path %>
  309.                 d-i mirror/http/proxy string<%= proxy_string %>
  310.                 d-i mirror/codename string <%= @host.operatingsystem.release_name %>
  311.                 d-i mirror/suite string <%= @host.operatingsystem.release_name %>
  312.                 d-i mirror/udeb/suite string <%= @host.operatingsystem.release_name %>
  313.  
  314.                 # Time settings
  315.                 d-i clock-setup/utc boolean true
  316.                 d-i time/zone string <%= @host.params['time-zone'] || 'UTC' %>
  317.  
  318.                 # NTP
  319.                 d-i clock-setup/ntp boolean true
  320.                 d-i clock-setup/ntp-server string <%= @host.params['ntp-server'] || '0.debian.pool.ntp.org' %>
  321.  
  322.                 # Set alignment for automatic partitioning
  323.                 # Choices: cylinder, minimal, optimal
  324.                 #d-i partman/alignment select cylinder
  325.  
  326.                 <%= @host.diskLayout %>
  327.  
  328.                 <% if @host.params['preseed-kernel-image'] -%>
  329.                 # Install different kernel
  330.                 d-i base-installer/kernel/image string <%= @host.params['preseed-kernel-image'] %>
  331.                 <% end %>
  332.  
  333.                 # User settings
  334.                 d-i passwd/root-password-crypted password <%= root_pass %>
  335.                 user-setup-udeb passwd/root-login boolean true
  336.                 d-i passwd/make-user boolean false
  337.                 user-setup-udeb passwd/make-user boolean false
  338.  
  339.                 <% repos = 0 %>
  340.  
  341.                 <% if salt_enabled -%>
  342.                 <% salt_package = 'salt-minion' -%>
  343.                 <% if @host.param_true?('enable-saltstack-repo') -%>
  344.                 <% if @host.operatingsystem.name == 'Debian' -%>
  345.                 d-i apt-setup/local<%= repos %>/repository string http://debian.saltstack.com/debian <%= @host.operatingsystem.release_name %>-saltstack main
  346.                 d-i apt-setup/local<%= repos %>/comment string SaltStack Repository
  347.                 d-i apt-setup/local<%= repos %>/key string http://debian.saltstack.com/debian-salt-team-joehealy.gpg.key
  348.                 <% repos += 1 -%>
  349.                 <% end -%>
  350.                 <% if @host.operatingsystem.name == 'Ubuntu' -%>
  351.                 d-i apt-setup/local<%= repos %>/repository string http://ppa.launchpad.net/saltstack/salt/ubuntu <%= @host.operatingsystem.release_name %> main
  352.                 d-i apt-setup/local<%= repos %>/comment string SaltStack Repository
  353.                 d-i apt-setup/local<%= repos %>/key string http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x4759FA960E27C0A6
  354.                 <% repos += 1 -%>
  355.                 <% end -%>
  356.                 <% end -%>
  357.                 <% else -%>
  358.                 <% salt_package = '' -%>
  359.                 <% end -%>
  360.  
  361.                 # Install minimal task set (see tasksel --task-packages minimal)
  362.                 tasksel tasksel/first multiselect minimal, ssh-server, openssh-server
  363.  
  364.                 # Install some base packages
  365.                 d-i pkgsel/include string <%= salt_package %> lsb-release python
  366.                 d-i pkgsel/update-policy select <%= @host.params['preseed-update-policy'] || 'unattended-upgrades' %>
  367.                 d-i pkgsel/upgrade select <%= @host.params['preseed-post-install-upgrade'] || 'none' %>
  368.  
  369.                 popularity-contest popularity-contest/participate boolean false
  370.  
  371.                 # Boot loader settings
  372.                 #grub-pc grub-pc/hidden_timeout boolean false
  373.                 #grub-pc grub-pc/timeout string 10
  374.                 d-i grub-installer/only_debian boolean true
  375.                 d-i grub-installer/with_other_os boolean true
  376.                 <% if @host.params['install-disk'] -%>
  377.                 d-i grub-installer/bootdev string <%= @host.params['install-disk'] %>
  378.                 <% elsif (@host.operatingsystem.name == 'Debian' and @host.operatingsystem.major.to_i >= 8) or (@host.operatingsystem.name == 'Ubuntu' and @host.operatingsystem.major.to_i >= 16) -%>
  379.                 d-i grub-installer/bootdev string default
  380.                 <% end -%>
  381.                 d-i finish-install/reboot_in_progress note
  382.  
  383.                 d-i preseed/late_command string wget -Y off <%= @static ? "'#{foreman_url('finish')}&static=true'" : foreman_url('finish') %> -O /target/tmp/finish.sh && in-target chmod +x /tmp/finish.sh && in-target /tmp/finish.sh
  384.  
  385.       snippet: false
  386.       audit-comment: initial import
  387.       template-kind-id: 5
  388.       template-combination-attribute:
  389.         - hostgroup:
  390.           environment:
  391.       os:
  392.         - name: Ubuntu 16.04 LTS
  393.       locked: false
  394.  
  395.     - name: Ubuntu Finish
  396.       template: |
  397.                <%#
  398.                 kind: finish
  399.                 name: Ubuntu Finish
  400.                 oses:
  401.                 - Debian
  402.                 - Ubuntu
  403.                 %>
  404.                 <%
  405.                   # safemode renderer does not support unary negation
  406.                   pm_set = @host.puppetmaster.empty? ? false : true
  407.                   puppet_enabled = pm_set || @host.param_true?('force-puppet')
  408.                   salt_enabled = @host.params['salt_master'] ? true : false
  409.                   chef_enabled = @host.respond_to?(:chef_proxy) && @host.chef_proxy
  410.                 %>
  411.  
  412.                 <% subnet = @host.subnet -%>
  413.                 <% if subnet.respond_to?(:dhcp_boot_mode?) -%>
  414.                 <% dhcp = subnet.dhcp_boot_mode? && !@static -%>
  415.                 <% else -%>
  416.                 <% dhcp = !@static -%>
  417.                 <% end -%>
  418.                 <% unless dhcp -%>
  419.                 # host and domain name need setting as these values may have come from dhcp if pxe booting
  420.                 /bin/sed -i "s/^search.*$/search <%= @host.domain %>/g" /etc/resolv.conf
  421.                 /bin/sed -i "s/.*dns-search.*/\tdns-search <%= @host.domain %>/g" /etc/network/interfaces
  422.                 /bin/sed -i "s/^<%= @host.ip %>.*/<%= @host.ip %>\t<%= @host.shortname %>.<%= @host.domain %>\t<%= @host.shortname %>/g" /etc/hosts
  423.                 /bin/echo <%= @host.shortname %> > /etc/hostname
  424.                 <% end -%>
  425.  
  426.                 <% if @host.info['parameters']['realm'] && @host.realm && @host.realm.realm_type == 'FreeIPA' -%>
  427.                 <%= snippet 'freeipa_register' %>
  428.                 <% end -%>
  429.  
  430.                 <%= snippet('remote_execution_ssh_keys') %>
  431.  
  432.                 <% if chef_enabled %>
  433.                 <%= snippet 'chef_client' %>
  434.                 <% end -%>
  435.  
  436.                 <% if puppet_enabled %>
  437.                 <% if @host.param_true?('enable-puppetlabs-pc1-repo') || @host.param_true?('enable-puppetlabs-repo') -%>
  438.                 <%= snippet 'puppetlabs_repo' %>
  439.                 <% end -%>
  440.                 <%= snippet 'puppet_setup' %>
  441.                 <% end -%>
  442.  
  443.                 <% if salt_enabled %>
  444.                 <%= snippet 'saltstack_setup' %>
  445.                 <% end -%>
  446.  
  447.                 <%= snippet 'preseed_networking_setup' %>
  448.                 /usr/bin/wget --no-proxy --quiet --output-document=/dev/null --no-check-certificate <%= foreman_url('built') %>
  449.  
  450.       snippet: false
  451.       audit-comment: initial import
  452.       template-kind-id: 6
  453.       template-combination-attribute:
  454.         - hostgroup:
  455.           environment:
  456.       os:
  457.         - name: Ubuntu 16.04 LTS
  458.       locked: false
  459.  
  460.  
  461.   os:
  462.     - name: Ubuntu
  463.       major: 16
  464.       minor: 4
  465.       description: Ubuntu 16.04 LTS
  466.       family: Debian
  467.       release-name: xenial
  468.       password-hash: SHA512
  469.       architecture:
  470.         - name: x86_64
  471.       provisioning-template:
  472.         - name: Ubuntu PXE
  473.         - name: Ubuntu Preseed
  474.         - name: Ubuntu Finish
  475.       medium:
  476.         - name: Ubuntu Mirror
  477.       partition-table:
  478.         - name: Ubuntu Default
  479.       parameters:
  480.         version: "16.04"
  481.         codename: "xenial"
  482.  
  483.   hostgroup:
  484.     - name: default
  485.       parent:
  486.       environment:
  487.       os: Ubuntu 16.04 LTS
  488.       architecture: x86_64
  489.       medium: Ubuntu Mirror
  490.       partition-table: Ubuntu Default
  491.       subnet: default
  492.       domain: {{ ansible_domain }}
  493.       parameters:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement