Skip to content

Commit

Permalink
Merge pull request #11 from the1Riddle/web-debugging
Browse files Browse the repository at this point in the history
Add a custom HTTP header with Puppet
  • Loading branch information
the1Riddle authored Dec 10, 2023
2 parents ffc9a05 + 981101f commit fc9aa3d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions 0x0F-load_balancer/2-puppet_custom_http_response_header.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@

exec { 'update':
provider => shell,
command => 'sudo apt-get -y update',
before => Exec['install Nginx']
command => 'sudo apt-get -y update',
before => Exec['install Nginx']
}

exec {'install Nginx':
provider => shell,
command => 'sudo apt-get -y install nginx',
before => Exec['install nginx'],
command => 'sudo apt-get -y install nginx',
before => Exec['install nginx'],
}

exec { 'add_header':
provider => shell,
provider => shell,
environment => ["HOST=${hostname}"],
command => 'sudo sed -i "s/include \/etc\/nginx\/sites-enabled\/*;/include \/etc\/nginx\/sites-enabled\/\*;\n\tadd_header X-Served-By \"$HOST\";/" /etc/nginx/nginx.conf',
before => Exec['restart Nginx'],
command => 'sudo sed -i "s/include \/etc\/nginx\/sites-enabled\/*;/include \/etc\/nginx\/sites-enabled\/\*;\n\tadd_header X-Served-By \"$HOST\";/" /etc/nginx/nginx.conf',
before => Exec['restart Nginx'],
}

exec { 'restart Nginx':
provider => shell,
command => 'sudo service nginx restart',
command => 'sudo service nginx restart',
}

0 comments on commit fc9aa3d

Please sign in to comment.