Browse Source

Make the other repo the main repo

Gabriel Corona 8 years ago
parent
commit
0e1ffae43c

+ 0 - 8
Gemfile

@@ -1,8 +0,0 @@
-source 'https://rubygems.org'
-
-gem 'puppet', '~> 3.7.2'
-gem 'hiera', '~> 1.3.4'
-gem 'hiera-puppet', '~> 1.0.0'
-gem 'r10k', '~> 1.1.4'
-
-# vim:ft=ruby

+ 0 - 38
Gemfile.lock

@@ -1,38 +0,0 @@
-GEM
-  remote: https://rubygems.org/
-  specs:
-    CFPropertyList (2.2.8)
-    colored (1.2)
-    cri (2.4.1)
-      colored (>= 1.2)
-    facter (2.4.6)
-      CFPropertyList (~> 2.2.6)
-    hiera (1.3.4)
-      json_pure
-    hiera-puppet (1.0.0)
-      hiera (~> 1.0)
-    json_pure (2.0.1)
-    log4r (1.1.10)
-    puppet (3.7.5)
-      facter (> 1.6, < 3)
-      hiera (~> 1.0)
-      json_pure
-    r10k (1.1.4)
-      colored (>= 1.2)
-      cri (~> 2.4.0)
-      json_pure
-      log4r (>= 1.1.10)
-      systemu (~> 2.5.2)
-    systemu (2.5.2)
-
-PLATFORMS
-  ruby
-
-DEPENDENCIES
-  hiera (~> 1.3.4)
-  hiera-puppet (~> 1.0.0)
-  puppet (~> 3.7.2)
-  r10k (~> 1.1.4)
-
-BUNDLED WITH
-   1.12.5

+ 0 - 51
Puppetfile

@@ -1,51 +0,0 @@
-# Puppetfile
-#
-# Infrastucture Lorraine Data Network <benevoles@listes.ldn-fai.net>
-#
-forge "https://forgeapi.puppetlabs.com"
-
-# Forge Modules
-mod 'sbadia/allknowingdns', '1.0.0'
-mod 'puppetlabs/accounts', '1.0.0'
-mod 'markhellewell/aptcacherng', '0.1.7'
-mod 'thomasvandoren/etckeeper', '0.0.9'
-mod 'thias/bind', '0.5.1'
-mod 'thias/postfix', '0.3.3'
-mod 'ssm/munin', '0.0.5'
-mod 'sbadia/bird', '0.0.5'
-mod 'ghoneycutt/dnsclient', '3.1.0'
-mod 'torian/ldap', '0.2.4'
-mod 'saz/locales', '2.1.0'
-mod 'sbadia/metche', '0.0.2'
-mod 'adrien/network', '0.4.1'
-#mod 'jvaubourg/nginxpack', '0.1.1'
-mod 'saz/rsyslog', '3.3.0'
-mod 'thias/sysctl', '0.3.2'
-mod 'saz/sudo', '3.0.6'
-mod 'saz/timezone', '3.0.1'
-mod 'saz/motd', '2.1.0'
-mod 'camptocamp/kmod', '0.1.2'
-mod 'sbadia/checkmk', '1.0.4'
-mod 'Aethylred/rrd', '0.1.3'
-
-# Git Modules
-# FIXME(sbadia): https://github.com/jfryman/puppet-inittab/pull/3
-mod 'jfryman/inittab',
-  :git => 'https://github.com/sbadia/puppet-inittab',
-  :ref => 'bd514bae0861a57bb831ab2e23e87bda8c69bb27'
-# FIXME(sbadia): not released yet
-mod 'jvaubourg/nginxpack',
-  :git => 'https://github.com/jvaubourg/puppetlabs-nginxpack',
-  :ref => '50a0fc2bcd2d1365aed7e7c1e76accb7baee17e7'
-
-## PuppetLabs
-mod 'puppetlabs/apache', '1.1.1'
-mod 'puppetlabs/apt', '1.7.0'
-mod 'puppetlabs/concat', '1.1.0'
-mod 'puppetlabs/mysql', '2.3.1'
-mod 'puppetlabs/ntp', '3.1.2'
-mod 'puppetlabs/stdlib', '4.3.2'
-mod 'puppetlabs/vcsrepo', '1.1.0'
-
-mod 'ldn',
-  :git => 'gitldn:puppet/puppet-ldn.git'

+ 0 - 80
README.md

@@ -1,80 +0,0 @@
-# Puppet for LDN
-
-## Summary
-
-* this repository should contain the public stuff;
-
-* `Puppetfile` list of external modules to load in `modules/`;
-
-* `modules/` contains the modules declared by `Puppetfile` and managed
-  by `r10k`,
-
-  * `modules/ldn` contains the private stuff (ideally it should be hiera files
-    only);
-
-* `internal-modules/` contains some modules local to this repository.
-
-## Installation
-
-### Prerequists
-
-* ssh (client)
-
-* git
-
-* Puppet stuff: puppet (3.7), hiera, r10k
-
-### Installing puppet with bundler
-
-You might want to install puppet using bundler in order to have the correct
-version (especially if your distribution does not ship the correct version):
-
-    apt install bundler
-    bundle install
-
-The local ruby/puppet commands must be executed with `bundle exec`:
-
-    bundle exec r10k puppetfile install Puppetfile
-
-### SSH
-
-This documentation assumes that your ~/.ssh/config is configured in order to
-access to the servers with `ssh $home.newldn` and the GIT repositories with
-`ssh gitldn`.
-
-## Basic usage
-
-Clone the repository:
-
-    git clone gitldn:puppet/puppet
-
-Install the modules:
-
-    r10k puppetfile install Puppetfile
-
-Update the puppet from the repository and apply:
-
-    # Update the puppet master from the git repo:
-    ssh zoidberg.newldn sudo /root/update.sh
-    
-    # Apply the rules from the puppet master on some server:
-    ssh foo.newldn sudo puppet agent -t
-
-## Development
-
-Don't forget to install the modules:
-
-    r10k puppetfile install Puppetfile
-
-Upload the current directory as as `test` environment on the Puppet master:
-
-    ./scripts/upload-env test
-
-Apply the `test` environment on some server:
-
-    ssh foo.newldn sudo puppet agent -t --environment=test
-
-Commit and push our modifications:
-
-    git commit -am"[vpn] Do something on the VPN"
-    git push origin HEAD

internal-modules/common/README.md → docs/common.md


+ 0 - 5
environment.conf

@@ -1,5 +0,0 @@
-# Managed by puppet
-environment_timeout=0
-manifest=manifests/00_site.pp
-modulepath=modules:internal-modules
-#config_version=/usr/local/bin/get_env_version.sh $environment

internal-modules/common/files/cronic → files/common/cronic


+ 0 - 13
manifests/00_site.pp

@@ -1,13 +0,0 @@
-node 'base' {
-  include '::common'
-  include '::ldn::users'
-}
-
-# File bucket
-filebucket { 'mainldn': server => 'zoidberg.ldn-fai.net' }
-File { backup => 'mainldn' }
-
-# Base path
-Exec { path => '/usr/bin:/usr/sbin:/bin:/sbin' }
-
-import '*.ldn-fai.net.pp'

+ 0 - 2
manifests/cannibalon.ldn-fai.net.pp

@@ -1,2 +0,0 @@
-node 'cannibalon.ldn-fai.net' inherits 'base' {
-}

+ 5 - 5
internal-modules/common/manifests/init.pp

@@ -1,5 +1,5 @@
-# Module:: common
-# Manifest:: init.pp
+# Module:: ldn
+# Manifest:: common.pp
 #
 # Lorraine Data Network http://ldn-fai.net/
 # Author:: Sebastien Badia (<seb@sebian.fr>)
@@ -10,7 +10,7 @@
 # Class:: common
 #
 #
-class common {
+class ldn::common {
 
   class {'dnsclient':
     nameservers => hiera_array('nameservers', undef),
@@ -51,7 +51,7 @@ class common {
   file {
     '/usr/local/bin/cronic':
       ensure => file,
-      source => 'puppet:///modules/common/cronic',
+      source => 'puppet:///modules/ldn/common/cronic',
       owner  => root,
       group  => root,
       mode   => '0755';
@@ -94,7 +94,7 @@ class common {
   # TODO, setup sources
   # TODO, setup ssh
 
-  class {'::motd': template => 'common/motd.erb'; }
+  class {'::motd': template => 'ldn/common/motd.erb'; }
 
   # Avoid a strange bug with facter
   # Could not retrieve fact='selinux', resolution='<anonymous>'': Invalid argument - /proc/self/attr/current

+ 6 - 6
internal-modules/dns/manifests/authoritative.pp

@@ -1,15 +1,15 @@
-# Module:: dns
-# Manifest:: authoritative.pp
+# Module:: ldn
+# Manifest:: dns/authoritative.pp
 #
 # Author:: Julien Vaubourg (<julien@vaubourg.com>)
 # Date:: 2013-09-21 13:36:02 +0200
 # Maintainer:: Julien Vaubourg (<julien@vaubourg.com>)
 #              Sebastien Badia (<seb@sebian.fr>)
 #
-# Class:: dns::authoritative inherits dns
+# Class:: ldn::dns::authoritative inherits dns
 #
 #
-class dns::authoritative inherits dns {
+class ldn::dns::authoritative inherits dns {
 
   package { 'zonecheck':
     ensure => installed,
@@ -40,7 +40,7 @@ class dns::authoritative inherits dns {
   }
 
   $zones = hiera_hash('zones', {})
-  create_resources(dns::zone, $zones)
+  create_resources(ldn::dns::zone, $zones)
 
 
-} # Class:: dns::authoritative inherits dns
+} # Class:: ldn::dns::authoritative inherits dns

+ 2 - 3
internal-modules/dns/manifests/init.pp

@@ -5,10 +5,9 @@
 # Date:: 2013-09-21 13:36:02 +0200
 # Maintainer:: Julien Vaubourg (<julien@vaubourg.com>)
 #
-# Class:: dns
+# Class:: ldn::dns
 #
 #
-class dns {
+class ldn::dns {
   include 'bind'
-
 }

+ 4 - 7
internal-modules/dns/manifests/zone.pp

@@ -1,15 +1,12 @@
-# Module:: dns
-# Manifest:: authoritative.pp
+# Module:: ldn
+# Manifest:: dns/authoritative.pp
 #
 # Author:: Julien Vaubourg (<julien@vaubourg.com>)
 # Date:: 2013-09-21 13:36:02 +0200
 # Maintainer:: Julien Vaubourg (<julien@vaubourg.com>)
 #              Sebastien Badia (<seb@sebian.fr>)
-#
-# Class:: dns::authoritative inherits dns
-#
-#
-define dns::zone {
+
+define ldn::dns::zone {
   bind::server::file {"db.$title":
     zonedir     => '/etc/bind/zones',
     owner       => 'bind',

+ 0 - 2
manifests/eternium.ldn-fai.net.pp

@@ -1,2 +0,0 @@
-node 'eternium.ldn-fai.net' inherits 'base' {
-}

+ 14 - 0
manifests/init.pp

@@ -0,0 +1,14 @@
+# Module:: common
+# Manifest:: init.pp
+#
+# Lorraine Data Network http://ldn-fai.net/
+# Author:: Sebastien Badia (<seb@sebian.fr>)
+# Date:: 2013-12-07 15:28:58 +0100
+# Maintainer:: Sebastien Badia (<seb@sebian.fr>)
+#
+
+# Class:: common
+#
+#
+class ldn {
+}

+ 0 - 3
manifests/zoidberg.ldn-fai.net.pp

@@ -1,3 +0,0 @@
-node 'zoidberg.ldn-fai.net' inherits 'base' {
-  include 'dns::authoritative'
-}

+ 14 - 0
metadata.json

@@ -0,0 +1,14 @@
+{
+  "name": "ldn",
+  "version": "0.0.1",
+  "author": "Lorraine Data Network",
+  "summary": "Lorraine Data Network internal puppet module (all specific configurations)",
+  "license": "Apache-2.0",
+  "source": "gitldn:puppet/puppet",
+  "project_page": "https://wiki.ldn-fai.net/w/Puppet",
+  "issues_url": "https://repo.ldn-fai.net/redmine/",
+  "dependencies": [
+    {"name":"puppetlabs-stdlib","version_requirement":">= 1.0.0"}
+  ],
+  "data_provider": null
+}

+ 0 - 52
scripts/upload-env

@@ -1,52 +0,0 @@
-#!/bin/sh
-
-set -e
-
-# ##### Basic functions
-
-log() {
-  echo "$@" >&2
-}
-
-die() {
-  echo "$1" >&2
-  exit "$2"
-}
-
-# Check that a value matched a given regex.
-# Usage: validate '^[a-zA-Z][-a-zA-Z0-9_]$' foo
-validate_grep() {
-    local value
-    local pattern
-    pattern="$1"
-    value="$2"
-    printf '%s\n' "$value" | wc -l | grep ^1$ > /dev/null || return 1
-    printf '%s\n' "$value" | grep -- "$pattern" > /dev/null || return 1
-    return 0
-}
-
-# ##### Argument processing
-
-if [ "$1" = "--help" ]; then
-  cat <<EOF
-Upload the working directory as an environment in the puppet server
-Usage: ./script upload-env my_environment
-EOF
-  exit 0
-fi
-
-env="$1"
-validate_grep '^[a-zA-Z][-a-zA-Z0-9_]*$' "$env" || die "Invalid environment name" 1
-test "$env" != "production" || die "Please, do not use with the production environment." 1
-
-# ##### Upload the stuff on the server
-
-sources="Gemfile Gemfile.lock modules internal-modules environment.conf manifests"
-path=/srv/puppet/$env/
-rsync_opt="-rl --perms --chmod=u+rwX,go+rX --delete --exclude .git*"
-puppet_host=zoidberg.newldn
-
-log "Create env on puppet server ($path)"
-ssh "$puppet_host" sudo mkdir -p "$path"
-ssh $puppet_host 'user=$(whoami) && group=$(id -gn) && sudo chown $user:$group' $path
-rsync $rsync_opt $sources "$puppet_host:${path}$dest"

internal-modules/common/templates/motd.erb → templates/common/motd.erb