#!/usr/bin/env bash apt-get install -y etckeeper git openssh-client # use the GitLab API to create a project # https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/projects.md#create-project # POST /projects # One of the optional parameters is: # visibility_level (optional): # 0 is Private (Project access must be granted explicitly for each user) # 10 is Internal (The project can be cloned by any logged in user), # 20 is Public (The project can be cloned without any authentication) cat /dev/zero | ssh-keygen -b 2048 -t rsa -q -N "" PROJECT_NAME=$(uname -n)_etc # myproject GITLAB_SERVER="http://example.com" PROJECT_URL="${GITLAB_SERVER}/api/v3/projects" KEYS_URL="${GITLAB_SERVER}/api/v3/user/keys" PRIVATE_TOKEN=QVy1PB7sTxfy4pqfZM1U PROJECT_VISIBILITY=0 PROJECT_DESCRIPTION="Tracking for the /etc/folder on $(uname -n)" MACHINE_PUBKEY=/root/.ssh/id_rsa.pub cat > ~/.ssh/config <