Project

General

Profile

Bug #7331 » foreman.sql

Dump of operatingsystems, operatingsystems, and os_default_templates tables - Paul Calabro, 09/07/2014 09:43 PM

 
--
-- PostgreSQL database dump
--

SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;

SET search_path = public, pg_catalog;

SET default_tablespace = '';

SET default_with_oids = false;

--
-- Name: config_templates; Type: TABLE; Schema: public; Owner: foreman; Tablespace:
--

CREATE TABLE config_templates (
id integer NOT NULL,
name character varying(255),
template text,
snippet boolean,
template_kind_id integer,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
locked boolean DEFAULT false,
"default" boolean DEFAULT false,
vendor character varying(255)
);


ALTER TABLE public.config_templates OWNER TO foreman;

--
-- Name: config_templates_id_seq; Type: SEQUENCE; Schema: public; Owner: foreman
--

CREATE SEQUENCE config_templates_id_seq
START WITH 1
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;


ALTER TABLE public.config_templates_id_seq OWNER TO foreman;

--
-- Name: config_templates_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: foreman
--

ALTER SEQUENCE config_templates_id_seq OWNED BY config_templates.id;


--
-- Name: config_templates_id_seq; Type: SEQUENCE SET; Schema: public; Owner: foreman
--

SELECT pg_catalog.setval('config_templates_id_seq', 51, true);


--
-- Name: operatingsystems; Type: TABLE; Schema: public; Owner: foreman; Tablespace:
--

CREATE TABLE operatingsystems (
id integer NOT NULL,
major character varying(5) DEFAULT ''::character varying NOT NULL,
name character varying(255),
minor character varying(16) DEFAULT ''::character varying NOT NULL,
nameindicator character varying(3),
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
release_name character varying(255),
type character varying(255),
description character varying(255),
hosts_count integer DEFAULT 0,
hostgroups_count integer DEFAULT 0
);


ALTER TABLE public.operatingsystems OWNER TO foreman;

--
-- Name: operatingsystems_id_seq; Type: SEQUENCE; Schema: public; Owner: foreman
--

CREATE SEQUENCE operatingsystems_id_seq
START WITH 1
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;


ALTER TABLE public.operatingsystems_id_seq OWNER TO foreman;

--
-- Name: operatingsystems_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: foreman
--

ALTER SEQUENCE operatingsystems_id_seq OWNED BY operatingsystems.id;


--
-- Name: operatingsystems_id_seq; Type: SEQUENCE SET; Schema: public; Owner: foreman
--

SELECT pg_catalog.setval('operatingsystems_id_seq', 9, true);


--
-- Name: os_default_templates; Type: TABLE; Schema: public; Owner: foreman; Tablespace:
--

CREATE TABLE os_default_templates (
id integer NOT NULL,
config_template_id integer,
template_kind_id integer,
operatingsystem_id integer,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);


ALTER TABLE public.os_default_templates OWNER TO foreman;

--
-- Name: os_default_templates_id_seq; Type: SEQUENCE; Schema: public; Owner: foreman
--

CREATE SEQUENCE os_default_templates_id_seq
START WITH 1
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;


ALTER TABLE public.os_default_templates_id_seq OWNER TO foreman;

--
-- Name: os_default_templates_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: foreman
--

ALTER SEQUENCE os_default_templates_id_seq OWNED BY os_default_templates.id;


--
-- Name: os_default_templates_id_seq; Type: SEQUENCE SET; Schema: public; Owner: foreman
--

SELECT pg_catalog.setval('os_default_templates_id_seq', 4, true);


--
-- Name: id; Type: DEFAULT; Schema: public; Owner: foreman
--

ALTER TABLE ONLY config_templates ALTER COLUMN id SET DEFAULT nextval('config_templates_id_seq'::regclass);


--
-- Name: id; Type: DEFAULT; Schema: public; Owner: foreman
--

ALTER TABLE ONLY operatingsystems ALTER COLUMN id SET DEFAULT nextval('operatingsystems_id_seq'::regclass);


--
-- Name: id; Type: DEFAULT; Schema: public; Owner: foreman
--

ALTER TABLE ONLY os_default_templates ALTER COLUMN id SET DEFAULT nextval('os_default_templates_id_seq'::regclass);


--
-- Data for Name: config_templates; Type: TABLE DATA; Schema: public; Owner: foreman
--

COPY config_templates (id, name, template, snippet, template_kind_id, created_at, updated_at, locked, "default", vendor) FROM stdin;
49 configure_host_file <%#\nkind: snippet\nname: configure_host_file\n%>\n\ncat > /etc/hosts << EOF\n#########################################################\n# #\n# THIS FILE IS MANAGED BY PUPPET! #\n# ANY AND ALL CHANGES NEED TO BE MADE ON THE #\n# PUPPETMASTER. OTHERWISE, LOCAL CHANGES WILL #\n# REVERT BACK ON THE NEXT PUPPET RUN! #\n# #\n#########################################################\n\n127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4\n::1 localhost localhost.localdomain localhost6 localhost6.localdomain6\n10.105.98.37 puppetmaster01.drt01.corp.tripadvisor.com\n<%= @host.ip -%> <%= @host.name -%> <%= @host.shortname %>\nEOF\n t \N 2014-08-30 04:48:14.649186 2014-09-03 22:59:23.060406 t f \N
11 Kickstart (Provision) <%#\nkind: provision\nname: Community Kickstart\noses:\n- CentOS 5\n- CentOS 6\n- CentOS 7\n%>\n\n<%\n rhel_compatible = @host.operatingsystem.family == 'Redhat' && @host.operatingsystem.name != 'Fedora'\n os_major = @host.operatingsystem.major.to_i\n%>\n\ninstall\n<%= @mediapath %>\nlang en_US.UTF-8\nselinux --permissive\nkeyboard us\nskipx\nnetwork --bootproto <%= @static ? "static --ip=#{@host.ip} --netmask=#{@host.subnet.mask} --gateway=#{@host.subnet.gateway} --nameserver=#{[@host.subnet.dns_primary,@host.subnet.dns_secondary].reject{|n| n.blank?}.join(',')}" : 'dhcp' %> --hostname <%= @host %>\nrootpw --iscrypted <%= root_pass %>\nfirewall --<%= os_major >= 6 ? 'service=' : '' %>ssh\nauthconfig --useshadow --passalgo=sha256 --kickstart\ntimezone <%= @host.params['time-zone'] || 'UTC' %>\n\n<%= snippet "disable_services" -%>\n\n# Configure the bootloader\nbootloader --location=mbr --append="nofb quiet splash=quiet" <%= grub_pass %>\n\n<% if @dynamic -%>\n# Partition the disk\n%include /tmp/diskpart.cfg\n<% else -%>\n# Partition the disk\n<%= @host.diskLayout -%>\n<% end -%>\n\ntext\nreboot\n\n# Install a few important packages\n%packages --ignoremissing\nyum\ndhclient\nntp\nwget\n@Core\nepel-release\n\n%end\n\n<% if @dynamic -%>\n%pre\n<%= @host.diskLayout %>\n%end\n<% end -%>\n\n%post --nochroot\nexec < /dev/tty3 > /dev/tty3\n#changing to VT 3 so that we can see whats going on....\n/usr/bin/chvt 3\n(\ncp -va /etc/resolv.conf /mnt/sysimage/etc/resolv.conf\n/usr/bin/chvt 1\n) 2>&1 | tee /mnt/sysimage/root/install.postnochroot.log\n%end\n\n%post\nlogger "Starting anaconda <%= @host %> postinstall"\nexec < /dev/tty3 > /dev/tty3\n#changing to VT 3 so that we can see whats going on....\n/usr/bin/chvt 3\n(\n\necho "Running finish script..."\n<%= snippet "configure_host_file" %>\n<%= snippet "configure_time" %>\n<%= snippet "install_epel" %>\n<%= snippet "install_yum_updates" %>\n<%= snippet "install_puppet" %>\n\nsync\n\n# Inform the build system that we are done.\necho "Informing Foreman that we are built"\nwget -q -O /dev/null --no-check-certificate <%= foreman_url %>\n\n# Sleeping an hour for debug\n) 2>&1 | tee /root/install.post.log\nexit 0\n\n%end\n f 4 2014-02-04 05:19:10.153448 2014-09-06 06:47:49.510493 t f \N
32 Boot disk iPXE - generic host #!ipxe\n# Example foreman_bootdisk generic host template\n#\n# This template is generic, but it will chainload to Foreman so expects the\n# host to be registered already.\n#\n# It loops through all interfaces using DHCP, requesting a template from\n# Foreman in the hope that one of the MACs or IPs matches.\n#\n# Copy this template to customize it, the original is read-only.\n\n# loop over net* until we can get a template\n<% (0..32).each do |i| -%>\n:net<%= i %>\nisset ${net<%= i -%>/mac} || goto no_nic\necho net<%= i -%> is a ${net<%= i -%>/chip} with MAC ${net<%= i -%>/mac}\ndhcp net<%= i %> || goto net<%= i+1 %>\nchain <%= bootdisk_chain_url %>${net<%= i -%>/mac} || goto net<%= i+1 %>\nexit 0\n<% end -%>\n\n:no_nic\necho Failed to chainload from any network interface\nsleep 30\nexit 1\n f 9 2014-02-17 23:07:01.763557 2014-08-16 08:44:44.809396 t t Foreman boot disk
51 test # t \N 2014-09-02 17:32:12.192132 2014-09-03 04:43:28.208911 f f \N
14 Kickstart (iPXE) #!gpxe\n<%#\nkind: iPXE\nname: Community Kickstart iPXE\noses:\n- CentOS 5\n- CentOS 6\n- Fedora 16\n- Fedora 17\n- Fedora 18\n- Fedora 19\n- RedHat 5\n- RedHat 6\n%>\n<% static = @host.token.nil? ? '?static=yes' : '&static=yes' -%>\n\n<%# This template will not function with Safemode set to true.\n Please disable it in Settings > Provisioning %>\n\nkernel <%= "#{@host.url_for_boot(:kernel)}" %> ks=<%= foreman_url('provision')%><%= static %> ksdevice=<%= @host.mac %> network kssendmac ip=${netX/ip} netmask=${netX/netmask} gateway=${netX/gateway} dns=${dns}\ninitrd <%= "#{@host.url_for_boot(:initrd)}" %>\n\nboot\n f 3 2014-02-04 05:19:10.174982 2014-08-29 22:58:34.497705 t f \N
25 install_epel <%#\nkind: snippet\nname: install_epel\n%>\n\n<%\n epel_url = "http://dl.fedoraproject.org/pub/epel/$major/$arch/epel-release-$os.noarch.rpm"\n\n case @host.operatingsystem.major\n when '4'\n epel_url.gsub!("$os",'4-10')\n when '5'\n epel_url.gsub!("$os",'5-4')\n when '6'\n epel_url.gsub!("$os",'6-8')\n else\n ''\n end\n-%>\n\nsu -c 'rpm -Uvh <%= @host.os.medium_uri(@host, epel_url) %>' t \N 2014-02-04 05:19:10.337158 2014-09-03 05:06:54.172551 t f \N
36 Kickstart (Finish) <%#\nkind: finish\nname: Kickstart default finish\noses:\n- CentOS 5\n- CentOS 6\n- CentOS 7\n%>\n\necho "Running finish script..."\n\n<%= snippet "update_time" -%>\n<%= snippet "install_epel" -%>\n<%= snippet "install_puppet" -%>\n<%= snippet "install_updates" -%>\n\n f 5 2014-05-04 01:23:23.775769 2014-08-30 00:08:17.621716 f f \N
42 disable_services <%#\nkind: snippet\nname: disable_services\n%>\n\n\n# Disable a bunch of services that we don't want enabled by default\nservices --disabled autofs,gpm,sendmail,cups,iptables,ip6tables,auditd,arptables_jf,xfs,pcmcia,isdn,rawdevices,hpoj,bluetooth,openibd,avahi-daemon,avahi-dnsconfd,hidd,hplip,pcscd,restorecond,mcstrans,rhnsd,yum-updatesd\n t \N 2014-08-02 04:25:16.090564 2014-09-03 22:57:55.77192 t f \N
40 configure_time <%#\nkind: snippet\nname: configure_time\n%>\n\n# Update local time\n/usr/sbin/ntpdate -sub <%= @host.params['ntp_server'] || 'time.tripadvisor.com' %>\n/usr/sbin/hwclock --systohc t \N 2014-08-02 02:53:42.371739 2014-09-03 22:58:46.46851 t f \N
39 install_puppet <%#\nkind: snippet\nname: install_puppet\n%>\n\n# Install Puppet Labs repo\nrpm -ivh http://yum.puppetlabs.com/puppetlabs-release-el-6.noarch.rpm\n\n# Install Puppet \nyum install puppet-3.6.2-1.el6.noarch -y\n\n# Setup puppet to run on system reboot\nchkconfig --level 345 puppet on\n\n# Perform first puppetrun\npuppet agent -t <%= @host.puppetmaster.blank? ? '' : "--server #{@host.puppetmaster}" %> t \N 2014-08-02 02:51:17.615566 2014-09-06 06:27:37.291992 t f \N
41 install_yum_updates <%#\nkind: snippet\nname: install_yum_updates\n%>\n\n# Install all Yum package updates\nyum -t -y -e 0 update t \N 2014-08-02 04:09:10.030246 2014-09-03 05:08:14.602829 t f \N
31 Boot disk iPXE - host #!ipxe\n# Example foreman_bootdisk host template\n# This template is rendered for use inside a host-specific boot disk.\n#\n# Copy this template to customize it, the original is read-only.\n\n<%\nbootdisk_raise(N_('Host has no IP address defined')) if @host.ip.nil? || @host.ip.empty?\nbootdisk_raise(N_('Host has no subnet defined')) unless @host.subnet\nbootdisk_raise(N_('Host has no domain defined')) unless @host.domain\nbootdisk_raise(N_('Subnet (%s) has no gateway defined'), @host.subnet) if @host.subnet.gateway.nil? || @host.subnet.gateway.empty?\nbootdisk_raise(N_('Subnet (%s) has no primary DNS server defined'), @host.subnet) if @host.subnet.dns_primary.nil? || @host.subnet.dns_primary.empty?\n%>\n\n# loop over net* until the host's MAC matches\n<% (0..32).each do |i| -%>\n:net<%= i %>\nisset ${net<%= i -%>/mac} || goto no_nic\necho net<%= i -%> is a ${net<%= i -%>/chip} with MAC ${net<%= i -%>/mac}\niseq ${net<%= i -%>/mac} <%= @host.mac -%> || goto net<%= i+1 %>\nifopen net<%= i %>\nset idx:int32 <%= i %>\ngoto loop_success\n<% end -%>\n\n:loop_success\necho Configuring net${idx} for static IP address\nifopen net${idx}\nset netX/ip <%= @host.ip %>\nset netX/netmask <%= @host.subnet.mask %>\nset netX/gateway <%= @host.subnet.gateway %>\nroute\n\n# Note, iPXE can only use one DNS server\nset dns <%= @host.subnet.dns_primary %>\nset domain <%= @host.domain.to_s %>\n\n# Chainload from Foreman rather than embedding OS info here, so the behaviour\n# is entirely dynamic.\nchain <%= bootdisk_chain_url %>\nexit 0\n\n:no_nic\necho Cannot find interface with MAC <%= @host.mac %>\nsleep 30\nexit 1\n f 9 2014-02-17 23:07:01.74868 2014-09-04 00:22:15.657058 t t Foreman boot disk
\.


--
-- Data for Name: operatingsystems; Type: TABLE DATA; Schema: public; Owner: foreman
--

COPY operatingsystems (id, major, name, minor, nameindicator, created_at, updated_at, release_name, type, description, hosts_count, hostgroups_count) FROM stdin;
6 6 XenServer 2 \N 2014-02-04 10:01:27.824303 2014-02-04 10:01:27.841629 \N \N XenServer release 6.2.0-70446c (xenenterprise) 15 0
7 6 RedHat 2 \N 2014-02-04 10:02:09.859071 2014-02-04 10:02:09.870578 \N Redhat XenServer 6.2.0-70446c 0 0
8 6 XenServer 1 \N 2014-03-27 05:42:39.096027 2014-03-27 05:42:39.225506 \N \N XenServer release 6.1.0-61002c (xenenterprise) 1 0
3 6 CentOS 3 \N 2014-02-04 09:09:17.13317 2014-02-04 09:09:17.13317 \N Redhat \N 0 0
1 6 CentOS 5 \N 2014-02-04 05:49:31.021692 2014-07-07 11:21:54.031407 Redhat CentOS 6.5 163 0
4 10 Ubuntu 04 \N 2014-02-04 09:59:45.29793 2014-02-04 09:59:45.334683 lucid Debian Ubuntu 10.04.4 LTS 12 0
5 1 RedHat 6 \N 2014-02-04 10:00:55.972612 2014-02-04 10:00:55.987634 \N Redhat XCP 1.6.10-61809c 2 0
9 5 CentOS 10 \N 2014-05-03 09:23:47.071394 2014-05-03 09:23:47.087371 \N Redhat CentOS 5.10 0 0
2 6 CentOS 4 \N 2014-02-04 08:17:52.858302 2014-02-04 08:17:52.858302 \N Redhat \N 1 0
\.


--
-- Data for Name: os_default_templates; Type: TABLE DATA; Schema: public; Owner: foreman
--

COPY os_default_templates (id, config_template_id, template_kind_id, operatingsystem_id, created_at, updated_at) FROM stdin;
1 14 3 1 2014-07-07 11:21:54.034405 2014-07-07 11:21:54.034405
3 11 4 1 2014-07-27 21:51:20.011628 2014-07-27 21:51:20.011628
4 36 5 1 2014-07-27 22:46:34.229621 2014-07-27 22:46:34.229621
2 51 7 1 2014-07-07 11:41:36.476234 2014-09-02 17:34:01.173213
\.


--
-- Name: config_templates_pkey; Type: CONSTRAINT; Schema: public; Owner: foreman; Tablespace:
--

ALTER TABLE ONLY config_templates
ADD CONSTRAINT config_templates_pkey PRIMARY KEY (id);


--
-- Name: operatingsystems_pkey; Type: CONSTRAINT; Schema: public; Owner: foreman; Tablespace:
--

ALTER TABLE ONLY operatingsystems
ADD CONSTRAINT operatingsystems_pkey PRIMARY KEY (id);


--
-- Name: os_default_templates_pkey; Type: CONSTRAINT; Schema: public; Owner: foreman; Tablespace:
--

ALTER TABLE ONLY os_default_templates
ADD CONSTRAINT os_default_templates_pkey PRIMARY KEY (id);


--
-- Name: index_operatingsystems_on_type; Type: INDEX; Schema: public; Owner: foreman; Tablespace:
--

CREATE INDEX index_operatingsystems_on_type ON operatingsystems USING btree (type);


--
-- Name: config_templates_template_kind_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: foreman
--

ALTER TABLE ONLY config_templates
ADD CONSTRAINT config_templates_template_kind_id_fk FOREIGN KEY (template_kind_id) REFERENCES template_kinds(id);


--
-- Name: os_default_templates_config_template_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: foreman
--

ALTER TABLE ONLY os_default_templates
ADD CONSTRAINT os_default_templates_config_template_id_fk FOREIGN KEY (config_template_id) REFERENCES config_templates(id);


--
-- Name: os_default_templates_operatingsystem_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: foreman
--

ALTER TABLE ONLY os_default_templates
ADD CONSTRAINT os_default_templates_operatingsystem_id_fk FOREIGN KEY (operatingsystem_id) REFERENCES operatingsystems(id);


--
-- Name: os_default_templates_template_kind_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: foreman
--

ALTER TABLE ONLY os_default_templates
ADD CONSTRAINT os_default_templates_template_kind_id_fk FOREIGN KEY (template_kind_id) REFERENCES template_kinds(id);


--
-- PostgreSQL database dump complete
--

    (1-1/1)