ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Project: Building a Chef 12 Server on DigitalOcean

    IT Discussion
    digitalocean chef chef 12 ubuntu 14.04 linux projects ubuntu opscode devops
    1
    15
    4.3k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • scottalanmillerS
      scottalanmiller
      last edited by scottalanmiller

      So tonight I am working on building a new Chef 12 server on Digital Ocean. I am going to be working from the DO documentation which has me using Ubuntu 14.04 LTS as the base for the server. Setting this Droplet up in their NYC datacenter. I have built Chef before, but going to go for the latest this time (I've built 11 before and worked on 10 and 11), going with the open source community version and doing it by DO's directions instead of the ones from OpsCode.

      My one divergence from the directions right at the beginning is to build a much smaller instance than the one that they suggest. OpsCode recommends four cores and 4GB of RAM. DigitalOcean runs their example on four cores and 8GB of RAM. I've found that these things are often overkill and am going to see what we can do with a single core and 1GB of RAM since this will be lightly used and growing it in the future is very simple to do.

      Let's have some fun with DevOps!

      opscode

      1 Reply Last reply Reply Quote 4
      • scottalanmillerS
        scottalanmiller
        last edited by

        Droplet creation is underway. Since I am going for such a small deployment, it is only $10/mo. Not bad at all.

        Following good naming convention, the new server is: dny-lnx-chef

        DNY: DigitalOcean New York
        LNX: Linux
        Chef: The application running there.

        1 Reply Last reply Reply Quote 2
        • scottalanmillerS
          scottalanmiller
          last edited by

          Added the new node into DNS on CloudFlare. We use key based access so it is already accessible from our main Jump Station.

          1 Reply Last reply Reply Quote 0
          • scottalanmillerS
            scottalanmiller
            last edited by

            Getting all system updates applied before getting down to business.

            1 Reply Last reply Reply Quote 0
            • scottalanmillerS
              scottalanmiller
              last edited by

              Downloading Chef 12.1.2 now.

              https://web-dl.packagecloud.io/chef/stable/packages/ubuntu/trusty/chef-server-core_12.1.2-1_amd64.deb

              1 Reply Last reply Reply Quote 0
              • scottalanmillerS
                scottalanmiller
                last edited by

                Install command:

                sudo dpkg -i chef-server-core_12.1.2-1_amd64.deb
                
                1 Reply Last reply Reply Quote 0
                • scottalanmillerS
                  scottalanmiller
                  last edited by

                  There was a warning in the DO instructions here: This will install the base Chef 12 system onto the server. If you have selected a server with less powerful hardware than the recommended amount, this step may fail.

                  But even on this little single core, 1GB RAM Droplet everything appears to have gone smoothly, no errors were generated.

                  1 Reply Last reply Reply Quote 0
                  • scottalanmillerS
                    scottalanmiller
                    last edited by

                    I always add a few extra packages of my own:

                    sudo apt-get install htop sysstat fail2ban
                    
                    1 Reply Last reply Reply Quote 0
                    • scottalanmillerS
                      scottalanmiller
                      last edited by

                      Turn on SAR data collection:

                      sudo vi /etc/default/sysstat
                      

                      Set the value of ENABLED to true.

                      1 Reply Last reply Reply Quote 0
                      • scottalanmillerS
                        scottalanmiller
                        last edited by

                        Because we are creating an instance that is so tiny and tight on resources, it would be smart to set up some swap space right from the beginning to make sure that we are as well situated as possible. This is a pretty standard procedure but DigitalOcean actually has a specific How To made for this specific to Ubuntu 14.04.

                        https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04

                        sudo fallocate -l 3G /swapfile
                        sudo chmod 600 /swapfile
                        sudo mkswap /swapfile
                        sudo swapon /swapfile
                        
                        1 Reply Last reply Reply Quote 0
                        • scottalanmillerS
                          scottalanmiller
                          last edited by

                          You will want to make that swap file permanent too:

                          echo "/swapfile   none    swap    sw    0   0" >> /etc/fstab
                          
                          1 Reply Last reply Reply Quote 0
                          • scottalanmillerS
                            scottalanmiller
                            last edited by

                            Next up, reconfiguring chef:

                            sudo chef-server-ctl reconfigure
                            

                            This step takes several minutes to run, so don't be surprised.

                            1 Reply Last reply Reply Quote 0
                            • scottalanmillerS
                              scottalanmiller
                              last edited by

                              Now it is time to create an admin user. Of course, you will need to modify this command for your own purposes.

                              chef-server-ctl user-create USERNAME FIRST_NAME LAST_NAME EMAIL PASSWORD
                              
                              1 Reply Last reply Reply Quote 0
                              • scottalanmillerS
                                scottalanmiller
                                last edited by

                                This last step will output a private key. Make sure to save this before going on to do anything else.

                                1 Reply Last reply Reply Quote 0
                                • scottalanmillerS
                                  scottalanmiller
                                  last edited by

                                  Now to make our first organization, we will make a test one to get started.

                                  chef-server-ctl org-create SHORTNAME LONGNAME --association_user USERNAME -f filename
                                  

                                  That's the format, here is a real command:

                                  chef-server-ctl org-create test "Chef Testing NonProd" --association_user scott -f scott.pem
                                  
                                  1 Reply Last reply Reply Quote 0
                                  • 1 / 1
                                  • First post
                                    Last post