I'm currently having trouble getting my module to work.
My goal here is to have a script that will add a repository to install brackets, install puppet, and copy an existing module
finaldigi/manifests/init.pp ---->>> /etc/puppet/modules folder
For some reason, the module works if I do all the script commands manually, but when I put them in a script and run it, it shows this error:
Error: Puppet::Parser::AST::Resource failed with error ArgumentError: Could not find declared class packagemodule at line 1 on node xubuntu.dhcp.inet.fi
Error: Puppet::Parser::AST::Resource failed with error ArgumentError: Could not find declared class packagemodule at line 1 on node xubuntu.dhcp.inet.fi
Here is my init.pp file
class packagemodule {
package { brackets:
ensure => 'installed',
allowcdrom => 'true',
}
package { apache2:
ensure => 'installed',
allowcdrom => 'true',
}
file {'/var/www/html/index.html':
content => "testing testing",
}
}
And my script:
#!/bin/bash
echo | sudo add-apt-repository ppa:webupd8team/brackets
sudo apt-get update
sudo apt-get install -y puppet
sudo cp -r ./finaldigi /etc/puppet/modules
sudo puppet apply -e 'class {packagemodule:}'
So yeah, it DOES work and won't show any errors if I type all the commands MANUALLY, but if I start putting all those commands in my bash script, it doesn't work and starts showing that error.
What am I missing here?