Question #1: If we run the puppet script again, won't the wget and echo be run twice? We will end up with duplicate repo in /etc/apt/sources.d. Running package { "opengeo-suite": } twice doesn't attempt to install the package twice, it simply ensures that its installed.

Question #2: Doing apt-get install opengeo-suite there are several promopts for user input. Will Puppet somehow know the default input to use, or will it crash?

Not to contradict any existing answers, but to add: apt also uses the directory /etc/apt/sources.list.d for repositories. Each file can contain one or more entries, and you can manage each file via Puppet file resources. Much easier than trying to work up idempotency via grep or other tools.
–
Mike RenfroApr 21 '13 at 13:09

2 Answers
2

If you don't prevent it, the commands will be run at every puppet run, including multiple entries in the sources.list. This should not happen, as Puppet expects that exec calls are idempotent. One way around this is to to create "check" files and run the exec only if the check file is not present. See the doc to learn how to do this. Also note that there exist user-contributed modules to maintain apt repos with Puppet.

I haven't used Puppet on an apt-based system (yet), but I guess that Puppet or the apt module I linked above is clever enough to handle this. If not, see this.