Skip to content

Commit 10c27be

Browse files
Seshagiri SriramSeshagiri Sriram
authored andcommitted
Added Misc Scripts - TIME TO CLEAN UP
1 parent ac6f9d1 commit 10c27be

File tree

5 files changed

+63
-2
lines changed

5 files changed

+63
-2
lines changed

INSTALL_NOTES/Sample_hieraYaml.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
:backends:
3+
- yaml
4+
:yaml:
5+
:datadir: "/etc/puppet/environments/%{environment}/hieradata"
6+
:hierarchy:
7+
- "%{profile}/common
8+
- "environments/%{environment}/%{::trusted.certname}"
9+
- "%{::trusted.certname}"
10+
- common
11+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
classes:
3+
- ntp
4+
- apache
5+
- postfix
6+
- tomcat
7+
ntp::restrict:
8+
-
9+
ntp::autoupdate: false
10+
ntp::enable: true
11+
ntp::servers:
12+
- 0.us.pool.ntp.org iburst
13+
- 1.us.pool.ntp.org iburst
14+
- 2.us.pool.ntp.org iburst
15+
- 3.us.pool.ntp.org iburst

INSTALL_NOTES/sample_site.pp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
hiera_include('classes')
2+
3+
Class A inherits BClass B inherits C
4+
Class C inerits D

SRC_CODE_EDUREKA_DEMO_PUPPET/Solution_2/java_tomcat_code.pp

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#install java
22
class tomcat {
3+
require java
34
group{'tomcat':
45
name =>'tomcat',
56
ensure => present,
@@ -27,6 +28,7 @@
2728
require => [ Exec['extracttomcat'], User['tomcat'] ] ,
2829
command => 'chgrp -R tomcat /opt/tomcat && /opt/tomcat/bin/startup.sh',
2930
cwd =>'/opt/tomcat/bin',
31+
source => puppet:///tomcat/xyz.txt
3032
}
3133
}
3234

@@ -42,8 +44,23 @@
4244
path => '/bin:/usr/sbin:/usr/bin:/sbin',
4345
command => 'add-apt-repository -y ppa:openjdk-r/ppa && apt-get update && apt-get install -y openjdk-8-jdk',
4446
user => 'root',
45-
}
47+
}
4648
}
4749

48-
class {'java':}->class{'tomcat':}
4950

51+
class {'java':'distribution' => 'jre', 'version' => '7.0'}-> class{'tomcat':} #Before -> Notify ~>
52+
#class {'tomcat':}
53+
54+
#Java 7 -> Tomcat 7 (tomcat 7 service is runinng)
55+
#Java 8 -> Tomcat 7 (Java 8 will be installed, will not restart the tomcat 7 service0
56+
#Java 8 ~> Tomcat 7 (Java 8 will be installed and tomcat 7 service will be restarted)
57+
#Java 8 ~> Tomcat 8 (Will skip java8, install Tomcat 8 and start tomcay 8 service)
58+
59+
60+
$_ = 10
61+
$__ = 20
62+
63+
$a = 10
64+
$b = 20
65+
$c = 30
66+
[$a, $b, $c] = [10,20,30]

scripts/runPuppet.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
sudo puppet agent -t
2+
case $? in
3+
0) echo "All OK" ; exit 0;
4+
;;
5+
2) echo "Some Changes made "; exit 0;
6+
;;
7+
4) echo "Failed to make changes"; exit 1;
8+
;;
9+
6) echo "Some changes made and some failed. check your log"; exit 2;
10+
;;
11+
*) echo "Unknown status"; exit 3;
12+
esac
13+
echo "All done"
14+

0 commit comments

Comments
 (0)