I apologize in advance if this question is too general - I'm happy to share 
specifics as needed. I'll attach a couple key files as a start on that.

I used the online tool PuPHPet to create a CentOS box that was close to 
meeting my needs, but because of that, my Puppet files are apparently more 
complex than they need to be (all examples I have seen in tutorials are far 
simpler). Then, because I was completely new to all this, I made changes to 
my actual server (by SSHing into my VM and rummaging around) while having 
absolutely no idea how to reflect those changes in the Puppet files.

Since then I have procrastinated on climbing this learning curve, but 
recently I upgraded Vagrant on the host, and now "vagrant global-status" 
says, "There are no active Vagrant environments on this computer! Or, you 
haven't destroyed and recreated Vagrant environments that were started with 
an older version of Vagrant." Hmph! I know I will lose my changes if I 
destroy and recreate, so I really need to figure out how to clean up my 
Puppet files. 

The directory structure looks like this:

│  Vagrantfile
│  
├─.vagrant
│  └─machines
│      └─default
│          └─virtualbox
│                  action_provision
│                  action_set_name
│                  id
│                  private_key
│                  synced_folders
│                  
└─puphpet
    │  config.yaml
    │  
    ├─files
    │  ├─dot
    │  │      .bash_aliases
    │  │      .vimrc
    │  │      
    │  ├─exec-always
    │  │      empty
    │  │      
    │  └─exec-once
    │          empty
    │          
    ├─puppet
    │      hiera.yaml
    │      manifest.pp
    │      Puppetfile
    │      
    └─shell
            execute-files.sh
            initial-setup.sh
            install_phalcon-devtools.sh
            install_phalcon.sh
            librarian-puppet-vagrant.sh
            os-detect.sh
            self-promotion.txt
            update-puppet.sh

puphpet/puppet/manifest.pp alone is 920 lines! I'm pretty sure most of 
that, as well as many of the other files, is unneeded code (I keep seeing 
things like "if $::osfamily == 'debian'...", for example). But the syntax 
is new to me, so I'm afraid to start slashing chunks of it.

A key piece of work I remember doing was on the nginx configuration, so 
I'll throw it out as a concrete example. A tree of the VM's /etc/nginx/ is 
as follows, with sizes and dates (as you can probably guess, I made the box 
in February last year and then fiddled with it off and on over the next 
couple months):

├── [       4096 Mar  6  2014]  conf.d
│   ├── [        888 Feb 13  2014]  default.conf
│   ├── [        427 Feb 11  2014]  example_ssl.conf
│   ├── [        415 Feb 13  2014]  proxy.conf
│   └── [       1469 Apr 26  2014]  vhost_autogen.conf
├── [       4096 Feb 13  2014]  conf.mail.d
├── [        963 Mar  6  2014]  fastcgi_params
├── [       4096 Mar  6  2014]  includes.d
│   └── [       1127 Mar 25  2014]  fastcgi_common
├── [       2837 Feb 11  2014]  koi-utf
├── [       2223 Feb 11  2014]  koi-win
├── [       3463 Feb 11  2014]  mime.types
├── [        565 Apr 19  2014]  nginx.conf
├── [        596 Feb 11  2014]  scgi_params
├── [        623 Feb 11  2014]  uwsgi_params
└── [       3610 Feb 11  2014]  win-utf

Most of the work I remember doing is in vhost_autogen.conf, but the string 
"autogen" doesn't appear in manifest.pp, so I don't know what code created 
that file. Perhaps I'm hopelessly ignorant, but can someone point me in the 
right direction? It's too bad that it isn't possible to create a Puppet 
manifest from an existing server... ;-)

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/9e6ad4ab-5a4f-450c-b8f1-9cc754b210e2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Attachment: manifest.pp
Description: Binary data

server {
  listen 80;
  server_name *.kizunadb.dev;
  root /var/www/kizunadb/public;

  access_log  /var/log/nginx/kizunadb.access.log;
  error_log   /var/log/nginx/kizunadb.error.log;
  
  index index.php index.html index.htm;

  try_files $uri $uri/ @rewrite;

  location @rewrite {
    rewrite ^/(.*)$ /index.php?_url=/$1;
  }
  location ~ ^(.+\.php)(/.*)?$ {
    fastcgi_param PATH_INFO $fastcgi_path_info;
    fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

    fastcgi_pass unix:/var/run/php5-fpm.sock;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    include fastcgi_params;
  }
}

server {
  listen 80 default_server;
  server_name     l4jp.dev;
  access_log /var/log/nginx/l4jp.dev.access.log;
  error_log /var/log/nginx/l4jp.dev.error.log;

  location / {
    root  /var/www/l4jp/public;
    try_files  $uri  $uri/  /index.php?$args ;
    index  index.html index.htm index.php;
  }

  location ~ \.php$ {
    root  /var/www/l4jp/public;
    try_files  $uri  $uri/  /index.php?$args ;
    index  index.html index.htm index.php;
    fastcgi_index index.php;
    fastcgi_param PATH_INFO $fastcgi_path_info;
    fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

    fastcgi_pass unix:/var/run/php5-fpm.sock;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    include fastcgi_params;
  }

}

Reply via email to