jLinux

Untitled

Dec 25th, 2015
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // File: seeds/dev/servers.js
  2.  
  3. 'use strict';
  4.  
  5. const Crypto = require('crypto');
  6. const _      = require('lodash');
  7.  
  8. exports.seed = function( knex, Promise ) {
  9.     let table = 'servers';
  10.  
  11.     return Promise.join(
  12.         // Removing the deletion, to avoid constraint errors
  13.         // (until we can get the insert working)
  14.         //knex( table ).del(),
  15.        
  16.         knex.insert([
  17.             {    // 1
  18.                 created_at: knex.fn.now(),
  19.                 server_hostname: 'lpweb01.server.ad',
  20.                 monitoring: 1,
  21.                 operating_system_id: 1,
  22.                 root_password: Crypto.createHash('md5').update( 'str - ' + _.random(0, 20) ).digest('hex')
  23.             }, { // 2
  24.                 created_at: knex.fn.now(),
  25.                 server_hostname: 'ldjen02.server.ad',
  26.                 monitoring: 1,
  27.                 operating_system_id: 2,
  28.                 root_password: Crypto.createHash('md5').update( 'str - ' + _.random(0, 20) ).digest('hex')
  29.             }, { // 3
  30.                 created_at: knex.fn.now(),
  31.                 server_hostname: 'lpnag01.server.ad',
  32.                 monitoring: 1,
  33.                 operating_system_id: 3,
  34.                 root_password: Crypto.createHash('md5').update( 'str - ' + _.random(0, 20) ).digest('hex')
  35.             }, { // 4
  36.                 created_at: knex.fn.now(),
  37.                 server_hostname: 'lpnag02.server.ad',
  38.                 monitoring: 1,
  39.                 operating_system_id: 3,
  40.                 root_password: Crypto.createHash('md5').update( 'str - ' + _.random(0, 20) ).digest('hex')
  41.             }, { // 5
  42.                 created_at: knex.fn.now(),
  43.                 server_hostname: 'lqchef01.server.ad',
  44.                 monitoring: 1,
  45.                 operating_system_id: 2,
  46.                 root_password: Crypto.createHash('md5').update( 'str - ' + _.random(0, 20) ).digest('hex')
  47.             }, { // 6
  48.                 created_at: knex.fn.now(),
  49.                 server_hostname: 'wpdir01.server.ad',
  50.                 monitoring: 1,
  51.                 operating_system_id: 4,
  52.                 root_password: Crypto.createHash('md5').update( 'str - ' + _.random(0, 20) ).digest('hex')
  53.             }, { // 7
  54.                 created_at: knex.fn.now(),
  55.                 server_hostname: 'wpdir02.server.ad',
  56.                 monitoring: 1,
  57.                 operating_system_id: 4,
  58.                 root_password: Crypto.createHash('md5').update( 'str - ' + _.random(0, 20) ).digest('hex')
  59.             }, { // 8
  60.                 created_at: knex.fn.now(),
  61.                 server_hostname: 'lptwst01.server.ad',
  62.                 monitoring: 1,
  63.                 operating_system_id: 1,
  64.                 root_password: Crypto.createHash('md5').update( 'str - ' + _.random(0, 20) ).digest('hex')
  65.             }, { // 9
  66.                 created_at: knex.fn.now(),
  67.                 server_hostname: 'lpngnx01.server.ad',
  68.                 monitoring: 1,
  69.                 operating_system_id: 1,
  70.                 root_password: Crypto.createHash('md5').update( 'str - ' + _.random(0, 20) ).digest('hex')
  71.             }, { // 10
  72.                 created_at: knex.fn.now(),
  73.                 server_hostname: 'wqbatch01.server.ad',
  74.                 monitoring: 0,
  75.                 operating_system_id: 1,
  76.                 root_password: Crypto.createHash('md5').update( 'str - ' + _.random(0, 20) ).digest('hex')
  77.             }, { // 11
  78.                 created_at: knex.fn.now(),
  79.                 server_hostname: 'lscacti01.server.ad',
  80.                 monitoring: 0,
  81.                 operating_system_id: 1,
  82.                 root_password: Crypto.createHash('md5').update( 'str - ' + _.random(0, 20) ).digest('hex')
  83.             }, { // 12
  84.                 created_at: knex.fn.now(),
  85.                 server_hostname: 'lqrhds01.server.ad',
  86.                 monitoring: 1,
  87.                 operating_system_id: 1,
  88.                 root_password: Crypto.createHash('md5').update( 'str - ' + _.random(0, 20) ).digest('hex')
  89.             }, { // 13
  90.                 created_at: knex.fn.now(),
  91.                 server_hostname: 'lqrhds02.server.ad',
  92.                 monitoring: 1,
  93.                 operating_system_id: 1,
  94.                 root_password: Crypto.createHash('md5').update( 'str - ' + _.random(0, 20) ).digest('hex')
  95.             }, { // 14
  96.                 created_at: knex.fn.now(),
  97.                 server_hostname: 'wsbamboo01.server.ad',
  98.                 monitoring: 1,
  99.                 operating_system_id: 1,
  100.                 root_password: Crypto.createHash('md5').update( 'str - ' + _.random(0, 20) ).digest('hex')
  101.             }
  102.         ]).into( table )
  103.   );
  104. };
Advertisement
Add Comment
Please, Sign In to add comment