├── .gitignore ├── Cron.xml ├── Description.html ├── README.md ├── arch.xml ├── license.txt ├── manifest.mf ├── nb-configuration.xml ├── newApacheConfTemplate.conf ├── pom.xml ├── screenshot-puppetfornetbeans.png └── src ├── main ├── java │ └── com │ │ └── tropyx │ │ └── nb_puppet │ │ ├── AuxPropsImpl.java │ │ ├── PPConstants.java │ │ ├── PPDeletedTextInterceptorFactory.java │ │ ├── PPEditorKit.java │ │ ├── PPTypedBreakInterceptorFactory.java │ │ ├── PPTypedTextInterceptorFactory.java │ │ ├── PuppetCustomizerProvider.java │ │ ├── PuppetManifestTypeDataObject.java │ │ ├── PuppetManifestTypeVisualElement.form │ │ ├── PuppetManifestTypeVisualElement.java │ │ ├── PuppetProject.java │ │ ├── PuppetProjectFactory.java │ │ ├── RecoPrivTemplatesImpl.java │ │ ├── YentaModuleInstall.java │ │ ├── completion │ │ ├── BuiltInFunctions.java │ │ ├── GlobalVarsFromPalette.java │ │ ├── PCompletionProvider.java │ │ ├── PPCompletionItem.java │ │ ├── PPFunctionCompletionItem.java │ │ ├── PPResourceCompletionItem.java │ │ └── PPVariableCompletionItem.java │ │ ├── erb │ │ └── ErbSupport.java │ │ ├── hiera │ │ ├── EyamlPanel.form │ │ ├── EyamlPanel.java │ │ ├── HieraCustomizerPanel.java │ │ ├── HieraEyamlMV.java │ │ ├── HieraPanel.form │ │ ├── HieraPanel.java │ │ ├── lock.png │ │ └── unlock.png │ │ ├── highlighter │ │ ├── MarkOccurrencesHighlighter.java │ │ └── MarkOccurrencesHighlightsLayerFactory.java │ │ ├── hyperlink │ │ └── PHyperlinkProvider.java │ │ ├── indexer │ │ ├── CpProvider.java │ │ ├── POH.java │ │ ├── PPIndexer.java │ │ └── PPIndexerFactory.java │ │ ├── jumpto │ │ ├── PPSymbolProvider.java │ │ └── PPTypeProvider.java │ │ ├── lexer │ │ ├── PLangHierarchy.java │ │ ├── PLanguageProvider.java │ │ ├── PLexer.java │ │ └── PTokenId.java │ │ ├── lint │ │ ├── AbstractFix.java │ │ ├── ArrowAlignmentFix.java │ │ ├── DoubleQuotedStringsFix.java │ │ ├── ExecutePuppetLintAction.java │ │ ├── LintCheck.java │ │ ├── LintCustomizerPanel.java │ │ ├── LintPanelUI.form │ │ ├── LintPanelUI.java │ │ ├── OnlyVariableStringFix.java │ │ ├── RakefileExtractor.java │ │ ├── SingleQuotedStringsFix.java │ │ ├── StatusProvider.java │ │ ├── TrailingWhitespaceFix.java │ │ └── VariablesNotEnclosedFix.java │ │ ├── newproject │ │ ├── PuppetModulePanelVisual.form │ │ ├── PuppetModulePanelVisual.java │ │ ├── PuppetModuleWizardIterator.java │ │ └── PuppetModuleWizardPanel.java │ │ ├── nodes │ │ ├── ManifestNavigator.java │ │ ├── ManifestsNodeFactory.java │ │ ├── ManifestsPanel.form │ │ └── ManifestsPanel.java │ │ ├── package-info.java │ │ ├── palette │ │ ├── PuppetManifestFileLayerPaletteFactory.java │ │ ├── PuppetPaletteUtilities.java │ │ ├── apache_vhost │ │ │ ├── ApacheVhost.java │ │ │ ├── ApacheVhostCustomizer.form │ │ │ └── ApacheVhostCustomizer.java │ │ ├── puppetfile │ │ │ ├── PuppetFile.java │ │ │ ├── PuppetFileCustomizer.form │ │ │ └── PuppetFileCustomizer.java │ │ └── puppetmaster │ │ │ ├── PuppetMaster.java │ │ │ ├── PuppetMasterCustomizer.form │ │ │ └── PuppetMasterCustomizer.java │ │ ├── parser │ │ ├── PBlob.java │ │ ├── PCase.java │ │ ├── PClass.java │ │ ├── PClassParam.java │ │ ├── PClassRef.java │ │ ├── PCondition.java │ │ ├── PDefine.java │ │ ├── PElement.java │ │ ├── PFunction.java │ │ ├── PIdentifier.java │ │ ├── PNode.java │ │ ├── PParamContainer.java │ │ ├── PResource.java │ │ ├── PResourceAttribute.java │ │ ├── PString.java │ │ ├── PTypeReference.java │ │ ├── PVariable.java │ │ ├── PVariableDefinition.java │ │ ├── PuppetParser.java │ │ ├── PuppetParserFactory.java │ │ └── PuppetParserResult.java │ │ ├── refactoring │ │ ├── PPActionsImplementationProvider.java │ │ ├── PPElementContext.java │ │ ├── PPRefactoringFactory.java │ │ ├── PPWhereUsedElement.java │ │ └── PPWhereUsedQueryPlugin.java │ │ └── semantic │ │ ├── Breadcrumbs.java │ │ └── SemanticColoring.java ├── puppet42 │ ├── augeas.pp │ ├── cron.pp │ ├── exec.pp │ ├── file.pp │ ├── group.pp │ ├── host.pp │ ├── interface.pp │ ├── mount.pp │ ├── package.pp │ ├── service.pp │ ├── ssh_authorized_key.pp │ ├── sshkey.pp │ └── user.pp └── resources │ └── com │ └── tropyx │ └── nb_puppet │ ├── Bundle.properties │ ├── PuppetManifestTemplate.pp │ ├── PuppetManifestTypeDescription.html │ ├── SimplePreview.pp │ ├── fontsAndColors.xml │ ├── hiera │ └── Bundle.properties │ ├── layer.xml │ ├── lint │ └── Bundle.properties │ ├── newproject │ ├── Bundle.properties │ ├── PuppetModuleDescription.html │ └── PuppetModuleProject.zip │ ├── palette │ ├── Bundle.properties │ ├── apache_vhost │ │ ├── ApacheVhost.xml │ │ └── Bundle.properties │ ├── assorted │ │ ├── Class.xml │ │ ├── Cron.xml │ │ ├── Exec.xml │ │ ├── Filebucket.xml │ │ ├── IfElse.xml │ │ ├── Node.xml │ │ ├── Notify.xml │ │ ├── Package.xml │ │ └── StageFirst.xml │ ├── puppetfile │ │ ├── Bundle.properties │ │ └── PuppetFile.xml │ ├── puppetmaster │ │ ├── Bundle.properties │ │ └── PuppetMaster.xml │ └── variables │ │ ├── architecture.xml │ │ ├── arp.xml │ │ ├── augeasversion.xml │ │ ├── boardmanufacturer.xml │ │ ├── boardproductname.xml │ │ ├── boardserialnumber.xml │ │ ├── cfkey.xml │ │ ├── domain.xml │ │ ├── ec2_userdata.xml │ │ ├── facterversion.xml │ │ ├── fqdn.xml │ │ ├── hardwareisa.xml │ │ ├── hardwaremodel.xml │ │ ├── hostname.xml │ │ ├── id.xml │ │ ├── interfaces.xml │ │ ├── ipaddress.xml │ │ ├── ipaddress6.xml │ │ ├── iphostnumber.xml │ │ ├── is_virtual.xml │ │ ├── kernel.xml │ │ ├── kernelmajversion.xml │ │ ├── kernelrelease.xml │ │ ├── kernelversion.xml │ │ ├── lsbdistcodename.xml │ │ ├── lsbdistdescription.xml │ │ ├── lsbdistid.xml │ │ ├── lsbdistrelease.xml │ │ ├── lsbmajdistrelease.xml │ │ ├── lsbrelease.xml │ │ ├── macaddress.xml │ │ ├── macosx_buildversion.xml │ │ ├── macosx_productname.xml │ │ ├── macosx_productversion.xml │ │ ├── macosx_productversion_major.xml │ │ ├── macosx_productversion_minor.xml │ │ ├── manufacturer.xml │ │ ├── memoryfree.xml │ │ ├── memorysize.xml │ │ ├── netmask.xml │ │ ├── newCron.xml │ │ ├── operatingsystem.xml │ │ ├── operatingsystemrelease.xml │ │ ├── osfamily.xml │ │ ├── path.xml │ │ ├── physicalprocessorcount.xml │ │ ├── processor.xml │ │ ├── processorcount.xml │ │ ├── productname.xml │ │ ├── ps.xml │ │ ├── puppetversion.xml │ │ ├── rubysitedir.xml │ │ ├── rubyversion.xml │ │ ├── selinux.xml │ │ ├── selinux_config_mode.xml │ │ ├── selinux_config_policy.xml │ │ ├── selinux_current_mode.xml │ │ ├── selinux_enforced.xml │ │ ├── selinux_mode.xml │ │ ├── selinux_policyversion.xml │ │ ├── serialnumber.xml │ │ ├── sshdsakey.xml │ │ ├── sshecdsakey.xml │ │ ├── sshrsakey.xml │ │ ├── swapencrypted.xml │ │ ├── swapfree.xml │ │ ├── swapsize.xml │ │ ├── timezone.xml │ │ ├── type.xml │ │ ├── uniqueid.xml │ │ ├── uptime.xml │ │ ├── uptime_days.xml │ │ ├── uptime_hours.xml │ │ ├── uptime_seconds.xml │ │ ├── virtual.xml │ │ ├── vlans.xml │ │ └── xendomains.xml │ └── resources │ ├── GPL_V3.txt │ ├── PuppetMaster16.png │ ├── PuppetMaster32.png │ ├── editor-preferences.xml │ ├── function.png │ ├── pp-file_icon.gif │ ├── puppet16.png │ ├── puppet_icon.gif │ ├── resources.gif │ └── variable.png └── test └── java └── com └── tropyx └── nb_puppet ├── hyperlink └── PHyperlinkProviderTest.java ├── lint └── RakefileExtractorTest.java └── parser ├── PStringTest.java └── PuppetParserTest.java /.gitignore: -------------------------------------------------------------------------------- 1 | /nbproject/private/ 2 | /build/ 3 | /private/ 4 | /target/ 5 | /userdir/ 6 | /nbproject/ -------------------------------------------------------------------------------- /Cron.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Description.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
.pp files are puppet manifest files
9 | 10 | 11 | -------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- 1 | Copyright (C) Tropyx Technology Pty Ltd and Michael Lindner Febuary 20 2013 2 | 3 | This program is free software: you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation, either version 3 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program. If not, see . 16 | */ 17 | package com.tropyx.nb_puppet; 18 | 19 | import org.netbeans.api.annotations.common.StaticResource; 20 | 21 | public final class PPConstants { 22 | @StaticResource 23 | public static final String ICON = "com/tropyx/nb_puppet/resources/puppet_icon.gif"; 24 | @StaticResource 25 | public static final String PUPPET_ICON = "com/tropyx/nb_puppet/resources/puppet_icon.gif"; 26 | public static final String PUPPET_PROJECT_TYPE = "com-tropyx-nb_puppet"; 27 | @StaticResource 28 | public static final String FUNCTION_ICON = "com/tropyx/nb_puppet/resources/function.png"; 29 | @StaticResource 30 | public static final String RESOURCE_ICON = "com/tropyx/nb_puppet/resources/resources.gif"; 31 | @StaticResource 32 | public static final String VARIABLE_ICON = "com/tropyx/nb_puppet/resources/variable.png"; 33 | public static final String MIME_TYPE = "text/x-puppet-manifest"; 34 | @StaticResource 35 | public static final String ICON_PUPPET_FILE = "com/tropyx/nb_puppet/resources/puppet16.png"; 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/tropyx/nb_puppet/PuppetManifestTypeVisualElement.form: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | -------------------------------------------------------------------------------- /src/main/java/com/tropyx/nb_puppet/RecoPrivTemplatesImpl.java: -------------------------------------------------------------------------------- 1 | package com.tropyx.nb_puppet; 2 | 3 | import org.netbeans.spi.project.ui.PrivilegedTemplates; 4 | import org.netbeans.spi.project.ui.RecommendedTemplates; 5 | 6 | public final class RecoPrivTemplatesImpl implements RecommendedTemplates, PrivilegedTemplates { 7 | 8 | private static final String[] PRIVILEGED_NAMES = { 9 | "Templates/Puppet/PuppetManifestTemplate.pp", 10 | "Templates/Other/Folder", 11 | }; 12 | private static final String[] TYPES = { 13 | "puppet", 14 | "XML", 15 | "simple-files" 16 | }; 17 | 18 | 19 | public RecoPrivTemplatesImpl() { 20 | } 21 | 22 | @Override 23 | public String[] getRecommendedTypes() { 24 | return TYPES.clone(); 25 | } 26 | 27 | @Override 28 | public String[] getPrivilegedTemplates() { 29 | return PRIVILEGED_NAMES; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/tropyx/nb_puppet/YentaModuleInstall.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 mkleint 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package com.tropyx.nb_puppet; 18 | 19 | import java.util.Arrays; 20 | import java.util.HashSet; 21 | import java.util.Set; 22 | import org.netbeans.contrib.yenta.Yenta; 23 | 24 | public class YentaModuleInstall extends Yenta { 25 | 26 | @Override 27 | protected Set friends() { 28 | return new HashSet<>(Arrays.asList(new String[] { 29 | "org.netbeans.modules.editor.breadcrumbs", 30 | "org.netbeans.modules.jumpto" 31 | })); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/tropyx/nb_puppet/completion/BuiltInFunctions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 mkleint 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package com.tropyx.nb_puppet.completion; 18 | 19 | public final class BuiltInFunctions { 20 | private final static String[] builtins = new String[] { 21 | "alert","collect","create_resources","crit", "defined", "each", "emerg", 22 | "epp", "extlookup", "file", "filter", "fqdn_rand", "generate", "hiera", 23 | "hiera_array", "hiera_hash", "hiera_include", "inline_epp", "inline_template", 24 | "lookup", "map", "md5", "reduce", "regsubst", "search", "select", 25 | "sha1", "shellquote", "slice", "split", "sprintf", "tagged", "template", 26 | "versioncmp" 27 | }; 28 | 29 | public static String[] get() { 30 | return builtins; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/tropyx/nb_puppet/completion/GlobalVarsFromPalette.java: -------------------------------------------------------------------------------- 1 | 2 | package com.tropyx.nb_puppet.completion; 3 | 4 | import java.util.ArrayList; 5 | import java.util.List; 6 | import org.openide.filesystems.FileObject; 7 | import org.openide.filesystems.FileUtil; 8 | 9 | public class GlobalVarsFromPalette { 10 | 11 | public static List get() { 12 | List toRet = new ArrayList<>(); 13 | FileObject dir = FileUtil.getConfigFile("PuppetPalette/Puppet Variables"); 14 | for (FileObject ch : dir.getChildren()) { 15 | String name = ch.getName(); 16 | toRet.add(name); 17 | } 18 | return toRet; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/tropyx/nb_puppet/hiera/EyamlPanel.form: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/main/java/com/tropyx/nb_puppet/hiera/HieraCustomizerPanel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 mkleint 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package com.tropyx.nb_puppet.hiera; 19 | 20 | import javax.swing.JComponent; 21 | import org.netbeans.api.project.Project; 22 | import org.netbeans.spi.project.ui.support.ProjectCustomizer; 23 | import org.openide.util.Lookup; 24 | 25 | //@ProjectCustomizer.CompositeCategoryProvider.Registration(projectType = "com-tropyx-nb_puppet", position = 200) 26 | public class HieraCustomizerPanel implements ProjectCustomizer.CompositeCategoryProvider{ 27 | 28 | @Override 29 | public ProjectCustomizer.Category createCategory(Lookup context) { 30 | return ProjectCustomizer.Category.create("Hiera", "Hiera", null); 31 | } 32 | 33 | @Override 34 | public JComponent createComponent(ProjectCustomizer.Category category, Lookup context) { 35 | return new HieraPanel(category, context.lookup(Project.class)); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/tropyx/nb_puppet/hiera/lock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tropyx/NetBeansPuppet/327704bb0e6216cca42de791a5210556beae6568/src/main/java/com/tropyx/nb_puppet/hiera/lock.png -------------------------------------------------------------------------------- /src/main/java/com/tropyx/nb_puppet/hiera/unlock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tropyx/NetBeansPuppet/327704bb0e6216cca42de791a5210556beae6568/src/main/java/com/tropyx/nb_puppet/hiera/unlock.png -------------------------------------------------------------------------------- /src/main/java/com/tropyx/nb_puppet/lexer/PLanguageProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 mkleint 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package com.tropyx.nb_puppet.lexer; 18 | 19 | import com.tropyx.nb_puppet.PPConstants; 20 | import org.netbeans.api.lexer.InputAttributes; 21 | import org.netbeans.api.lexer.Language; 22 | import org.netbeans.api.lexer.LanguagePath; 23 | import org.netbeans.api.lexer.Token; 24 | import org.netbeans.spi.lexer.LanguageEmbedding; 25 | import org.netbeans.spi.lexer.LanguageProvider; 26 | 27 | /** 28 | * 29 | * @author Milos Kleint 30 | */ 31 | @org.openide.util.lookup.ServiceProvider(service=org.netbeans.spi.lexer.LanguageProvider.class) 32 | public class PLanguageProvider extends LanguageProvider { 33 | 34 | @Override 35 | public Language findLanguage (String mimeType) { 36 | if (PPConstants.MIME_TYPE.equals (mimeType)) 37 | return new PLangHierarchy ().language (); 38 | return null; 39 | } 40 | 41 | @Override 42 | public LanguageEmbedding findLanguageEmbedding ( 43 | Token arg0, 44 | LanguagePath arg1, 45 | InputAttributes arg2 46 | ) { 47 | return null; 48 | } 49 | } 50 | 51 | 52 | -------------------------------------------------------------------------------- /src/main/java/com/tropyx/nb_puppet/lint/DoubleQuotedStringsFix.java: -------------------------------------------------------------------------------- 1 | package com.tropyx.nb_puppet.lint; 2 | 3 | import com.tropyx.nb_puppet.lexer.PTokenId; 4 | import javax.swing.text.Document; 5 | import org.netbeans.api.lexer.Token; 6 | import org.netbeans.api.lexer.TokenSequence; 7 | 8 | class DoubleQuotedStringsFix extends AbstractFix { 9 | 10 | DoubleQuotedStringsFix(Document document, int startindex, int endindex) { 11 | super(document, startindex, endindex, "Double Quoted Strings - replace with single quotes"); 12 | } 13 | 14 | @Override 15 | protected DocumentChange changeForToken(Token token, TokenSequence ts) { 16 | if (token.id() == PTokenId.STRING_LITERAL) { 17 | String txt = token.text().toString(); 18 | if (txt.startsWith("\"") && txt.endsWith("\"")) { 19 | final int start = ts.offset(); 20 | final int end = start + token.length() - 1; 21 | return new DocumentChange() { 22 | @Override 23 | public void run() throws Exception { 24 | document.remove(start, 1); 25 | document.insertString(start, "'", null); 26 | document.remove(end, 1); 27 | document.insertString(end, "'", null); 28 | } 29 | }; 30 | } 31 | } 32 | return null; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/tropyx/nb_puppet/lint/LintCustomizerPanel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 mkleint 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package com.tropyx.nb_puppet.lint; 19 | 20 | import javax.swing.JComponent; 21 | import org.netbeans.api.project.Project; 22 | import org.netbeans.spi.project.ui.support.ProjectCustomizer; 23 | import org.openide.util.Lookup; 24 | 25 | @ProjectCustomizer.CompositeCategoryProvider.Registration(projectType = "com-tropyx-nb_puppet", position = 100) 26 | public class LintCustomizerPanel implements ProjectCustomizer.CompositeCategoryProvider{ 27 | 28 | @Override 29 | public ProjectCustomizer.Category createCategory(Lookup context) { 30 | return ProjectCustomizer.Category.create("Lint", "Puppet Lint", null); 31 | } 32 | 33 | @Override 34 | public JComponent createComponent(ProjectCustomizer.Category category, Lookup context) { 35 | return new LintPanelUI(category, context.lookup(Project.class)); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/tropyx/nb_puppet/lint/RakefileExtractor.java: -------------------------------------------------------------------------------- 1 | 2 | package com.tropyx.nb_puppet.lint; 3 | 4 | import java.io.IOException; 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | import java.util.regex.Matcher; 8 | import java.util.regex.Pattern; 9 | import org.netbeans.spi.project.AuxiliaryProperties; 10 | import org.openide.filesystems.FileObject; 11 | 12 | public class RakefileExtractor { 13 | public static final String USE_RAKEFILE = "useRakefile"; 14 | 15 | public static boolean isUseRakefile(AuxiliaryProperties prefs) { 16 | String rr = prefs.get(RakefileExtractor.USE_RAKEFILE, true); 17 | if (rr == null) { 18 | rr = "true"; 19 | } 20 | return Boolean.parseBoolean(rr); 21 | } 22 | 23 | private static final Pattern PATTERN1 = Pattern.compile("PuppetLint.configuration.send\\('disable_(.*)'\\)"); 24 | private static final Pattern PATTERN2 = Pattern.compile("PuppetLint.configuration.send\\('(.*)'\\)"); 25 | public static String[] getConfiguration(FileObject fo) throws IOException { 26 | List toRet = new ArrayList<>(); 27 | for (String line : fo.asLines("UTF-8")) { 28 | Matcher matcher = PATTERN1.matcher(line); 29 | if (matcher.find()) { 30 | toRet.add("--no-" + matcher.group(1) + "-check"); 31 | } else { 32 | matcher = PATTERN2.matcher(line); 33 | if (matcher.find()) { 34 | toRet.add("--" + matcher.group(1)); 35 | } 36 | } 37 | } 38 | return toRet.toArray(new String[0]); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/tropyx/nb_puppet/lint/SingleQuotedStringsFix.java: -------------------------------------------------------------------------------- 1 | package com.tropyx.nb_puppet.lint; 2 | 3 | import com.tropyx.nb_puppet.lexer.PTokenId; 4 | import javax.swing.text.Document; 5 | import org.netbeans.api.lexer.Token; 6 | import org.netbeans.api.lexer.TokenSequence; 7 | 8 | class SingleQuotedStringsFix extends AbstractFix { 9 | 10 | SingleQuotedStringsFix(Document document, int startindex, int endindex) { 11 | super(document, startindex, endindex, "Single Quoted String with variables - replace with double quotes"); 12 | } 13 | 14 | @Override 15 | protected DocumentChange changeForToken(Token token, TokenSequence ts) { 16 | if (token.id() == PTokenId.STRING_LITERAL) { 17 | String txt = token.text().toString(); 18 | if (txt.startsWith("\'") && txt.endsWith("\'")) { 19 | final int start = ts.offset(); 20 | final int end = start + token.length() - 1; 21 | return new DocumentChange() { 22 | @Override 23 | public void run() throws Exception { 24 | document.remove(start, 1); 25 | document.insertString(start, "\"", null); 26 | document.remove(end, 1); 27 | document.insertString(end, "\"", null); 28 | } 29 | }; 30 | } 31 | } 32 | return null; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/tropyx/nb_puppet/lint/TrailingWhitespaceFix.java: -------------------------------------------------------------------------------- 1 | 2 | package com.tropyx.nb_puppet.lint; 3 | 4 | import com.tropyx.nb_puppet.lexer.PTokenId; 5 | import javax.swing.text.Document; 6 | import org.netbeans.api.lexer.Token; 7 | import org.netbeans.api.lexer.TokenSequence; 8 | 9 | class TrailingWhitespaceFix extends AbstractFix { 10 | 11 | public TrailingWhitespaceFix(Document document, int startindex, int endindex) { 12 | super(document, startindex, endindex, "Trailing whitespace - remove"); 13 | } 14 | 15 | @Override 16 | protected DocumentChange changeForToken(Token token, TokenSequence ts) { 17 | if (token.id() == PTokenId.WHITESPACE) { 18 | String text = token.text().toString(); 19 | final int index = text.indexOf("\n"); 20 | final int start = ts.offset(); 21 | if (text.indexOf("\n") > 0) { 22 | return new DocumentChange() { 23 | @Override 24 | public void run() throws Exception { 25 | document.remove(start, index); 26 | } 27 | }; 28 | } 29 | } 30 | return null; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/tropyx/nb_puppet/lint/VariablesNotEnclosedFix.java: -------------------------------------------------------------------------------- 1 | 2 | package com.tropyx.nb_puppet.lint; 3 | 4 | import com.tropyx.nb_puppet.lexer.PTokenId; 5 | import javax.swing.text.Document; 6 | import org.netbeans.api.lexer.Token; 7 | import org.netbeans.api.lexer.TokenSequence; 8 | 9 | class VariablesNotEnclosedFix extends AbstractFix { 10 | 11 | public VariablesNotEnclosedFix(Document document, int startindex, int endindex) { 12 | super(document, startindex, endindex, "Variable not enclosed - surround with {}"); 13 | } 14 | 15 | @Override 16 | protected DocumentChange changeForToken(Token token, TokenSequence ts) { 17 | return null; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/tropyx/nb_puppet/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Tropyx Technology Pty Ltd and Michael Lindner 2013 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | @TemplateRegistration( 19 | folder = "Puppet", 20 | content = "PuppetManifestTemplate.pp", 21 | displayName = "Puppet Manifest File", 22 | category = {"puppet", "simple-files"}, 23 | position = 397, 24 | requireProject = false, 25 | description = "PuppetManifestTypeDescription.html" 26 | ) 27 | 28 | package com.tropyx.nb_puppet; 29 | 30 | import org.netbeans.api.templates.TemplateRegistration; 31 | 32 | -------------------------------------------------------------------------------- /src/main/java/com/tropyx/nb_puppet/palette/apache_vhost/ApacheVhost.java: -------------------------------------------------------------------------------- 1 | package com.tropyx.nb_puppet.palette.apache_vhost; 2 | 3 | import com.tropyx.nb_puppet.palette.apache_vhost.*; 4 | import com.tropyx.nb_puppet.palette.PuppetPaletteUtilities; 5 | import javax.swing.text.BadLocationException; 6 | import javax.swing.text.JTextComponent; 7 | import org.openide.text.ActiveEditorDrop; 8 | 9 | public class ApacheVhost implements ActiveEditorDrop { 10 | 11 | private String hostname = ""; 12 | 13 | public ApacheVhost() { 14 | } 15 | 16 | private String createBody() { 17 | hostname = getHostName(); 18 | String snippet = "\n\napache::vhost {'" + hostname + "':\n" 19 | + "\t\tport => 80,\n" 20 | + "\t\tdocroot => '/var/www/personal',\n" 21 | + "\t\toptions => 'Indexes MultiViews'," 22 | + "\t\t}\n"; 23 | return snippet; 24 | } 25 | 26 | @Override 27 | public boolean handleTransfer(JTextComponent targetComponent) { 28 | ApacheVhostCustomizer c = new ApacheVhostCustomizer(this, targetComponent); 29 | boolean accept = c.showDialog(); 30 | if (accept) { 31 | String body = createBody(); 32 | try { 33 | PuppetPaletteUtilities.insert(body, targetComponent); 34 | } catch (BadLocationException ble) { 35 | accept = false; 36 | } 37 | } 38 | return accept; 39 | } 40 | 41 | public String getHostName() { 42 | return hostname; 43 | } 44 | 45 | public void setHostName(String hostname) { 46 | this.hostname = hostname; 47 | } 48 | } -------------------------------------------------------------------------------- /src/main/java/com/tropyx/nb_puppet/palette/puppetfile/PuppetFile.java: -------------------------------------------------------------------------------- 1 | package com.tropyx.nb_puppet.palette.puppetfile; 2 | 3 | import com.tropyx.nb_puppet.palette.puppetfile.*; 4 | import com.tropyx.nb_puppet.palette.PuppetPaletteUtilities; 5 | import javax.swing.text.BadLocationException; 6 | import javax.swing.text.JTextComponent; 7 | import org.openide.text.ActiveEditorDrop; 8 | 9 | public class PuppetFile implements ActiveEditorDrop { 10 | 11 | private String hostname = ""; 12 | 13 | public PuppetFile() { 14 | } 15 | 16 | private String createBody() { 17 | hostname = getFileName(); 18 | String snippet = "\n\nfile { \"/etc/sudoers\":" 19 | + "\n\t mode => 440," 20 | + "\n\t owner => root," 21 | + "\n\t group => root," 22 | + "\n\t source => \"puppet:///modules/admin/sudoers\"," 23 | + "\n\t backup => \".bak\"" 24 | + "\n\t }\n"; 25 | return snippet; 26 | } 27 | 28 | @Override 29 | public boolean handleTransfer(JTextComponent targetComponent) { 30 | PuppetFileCustomizer c = new PuppetFileCustomizer(this, targetComponent); 31 | boolean accept = c.showDialog(); 32 | if (accept) { 33 | String body = createBody(); 34 | try { 35 | PuppetPaletteUtilities.insert(body, targetComponent); 36 | } catch (BadLocationException ble) { 37 | accept = false; 38 | } 39 | } 40 | return accept; 41 | } 42 | 43 | public String getFileName() { 44 | return hostname; 45 | } 46 | 47 | public void setFileName(String hostname) { 48 | this.hostname = hostname; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/tropyx/nb_puppet/palette/puppetmaster/PuppetMaster.java: -------------------------------------------------------------------------------- 1 | package com.tropyx.nb_puppet.palette.puppetmaster; 2 | 3 | import com.tropyx.nb_puppet.palette.PuppetPaletteUtilities; 4 | import javax.swing.text.BadLocationException; 5 | import javax.swing.text.JTextComponent; 6 | import org.openide.text.ActiveEditorDrop; 7 | 8 | public class PuppetMaster implements ActiveEditorDrop { 9 | 10 | private String puppetmaster = ""; 11 | 12 | public PuppetMaster() { 13 | } 14 | 15 | private String createBody() { 16 | puppetmaster = getPuppetMaster(); 17 | String Pm = "$puppetmaster=\'" + puppetmaster + "\'" 18 | + "\n"; 19 | return Pm; 20 | } 21 | 22 | @Override 23 | public boolean handleTransfer(JTextComponent targetComponent) { 24 | PuppetMasterCustomizer c = new PuppetMasterCustomizer(this, targetComponent); 25 | boolean accept = c.showDialog(); 26 | if (accept) { 27 | String body = createBody(); 28 | try { 29 | PuppetPaletteUtilities.insert(body, targetComponent); 30 | } catch (BadLocationException ble) { 31 | accept = false; 32 | } 33 | } 34 | return accept; 35 | } 36 | 37 | public String getPuppetMaster() { 38 | return puppetmaster; 39 | } 40 | 41 | public void setPuppetMaster(String puppetmaster) { 42 | this.puppetmaster = puppetmaster; 43 | } 44 | 45 | } -------------------------------------------------------------------------------- /src/main/java/com/tropyx/nb_puppet/parser/PBlob.java: -------------------------------------------------------------------------------- 1 | 2 | package com.tropyx.nb_puppet.parser; 3 | 4 | public class PBlob extends PElement { 5 | 6 | private int endOffset; 7 | 8 | public PBlob(PElement parent, int offset) { 9 | super(BLOB, parent, offset); 10 | } 11 | 12 | @Override 13 | public int getEndOffset() { 14 | return endOffset; 15 | } 16 | 17 | public void setEndOffset(int length) { 18 | this.endOffset = length; 19 | } 20 | 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/tropyx/nb_puppet/parser/PCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 mkleint 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package com.tropyx.nb_puppet.parser; 19 | 20 | import java.util.HashMap; 21 | import java.util.Map; 22 | 23 | public class PCase extends PElement { 24 | 25 | private PBlob control; 26 | 27 | private final Map cases = new HashMap<>(); 28 | 29 | public PCase(PElement parent, int offset) { 30 | super(CASE, parent, offset); 31 | } 32 | 33 | public PBlob getControl() { 34 | return control; 35 | } 36 | 37 | public void setControl(PBlob control) { 38 | this.control = control; 39 | } 40 | 41 | public Map getCases() { 42 | return cases; 43 | } 44 | 45 | 46 | void addCase(PBlob cas, PBlob caseBody) { 47 | cases.put(cas, caseBody); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/tropyx/nb_puppet/parser/PClassRef.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 mkleint 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package com.tropyx.nb_puppet.parser; 19 | 20 | public class PClassRef extends PElement { 21 | private PIdentifier name; 22 | 23 | public PClassRef(PElement parent, int offset) { 24 | super(CLASS_REF, parent, offset); 25 | } 26 | 27 | public String getName() { 28 | return name.getName(); 29 | } 30 | 31 | void setName(PIdentifier name) { 32 | this.name = name; 33 | } 34 | 35 | @Override 36 | public String toString() { 37 | return super.toString() + "[" + getName() + "]"; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/tropyx/nb_puppet/parser/PCondition.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 mkleint 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package com.tropyx.nb_puppet.parser; 19 | 20 | public class PCondition extends PElement { 21 | 22 | private PBlob condition; 23 | 24 | private PBlob consequence; 25 | 26 | private PElement otherwise; 27 | 28 | public PCondition(PElement parent, int offset) { 29 | super(CONDITION, parent, offset); 30 | } 31 | 32 | public PBlob getCondition() { 33 | return condition; 34 | } 35 | 36 | public void setCondition(PBlob condition) { 37 | this.condition = condition; 38 | } 39 | 40 | public PBlob getConsequence() { 41 | return consequence; 42 | } 43 | 44 | public void setConsequence(PBlob consequence) { 45 | this.consequence = consequence; 46 | } 47 | 48 | public PElement getOtherwise() { 49 | return otherwise; 50 | } 51 | 52 | public void setOtherwise(PElement otherwise) { 53 | this.otherwise = otherwise; 54 | } 55 | 56 | 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/com/tropyx/nb_puppet/parser/PDefine.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 mkleint 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package com.tropyx.nb_puppet.parser; 19 | 20 | public class PDefine extends PElement implements PParamContainer { 21 | private String name; 22 | private PClassParam[] params = new PClassParam[0]; 23 | 24 | public PDefine(PElement parent, int offset) { 25 | super(DEFINE, parent, offset); 26 | } 27 | 28 | public String getName() { 29 | return name; 30 | } 31 | 32 | void setName(String name) { 33 | this.name = name; 34 | } 35 | 36 | @Override 37 | public PClassParam[] getParams() { 38 | return params; 39 | } 40 | 41 | @Override 42 | public void setParams(PClassParam[] params) { 43 | assert params != null; 44 | this.params = params; 45 | } 46 | 47 | @Override 48 | public String toString() { 49 | return super.toString() + "[" + name + "]"; 50 | } 51 | 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/com/tropyx/nb_puppet/parser/PFunction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 mkleint 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package com.tropyx.nb_puppet.parser; 19 | 20 | /** 21 | * function call 22 | */ 23 | public class PFunction extends PElement { 24 | private final String name; 25 | 26 | public PFunction(PElement parent, int offset, String name) { 27 | super(FUNCTION, parent, offset); 28 | this.name = name; 29 | } 30 | 31 | public String getName() { 32 | return name; 33 | } 34 | 35 | @Override 36 | public String toString() { 37 | return super.toString() + "[" + name + "]"; 38 | } 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/tropyx/nb_puppet/parser/PIdentifier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 mkleint 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package com.tropyx.nb_puppet.parser; 19 | 20 | /** 21 | * function call 22 | */ 23 | public class PIdentifier extends PElement { 24 | private final String name; 25 | 26 | public PIdentifier(PElement parent, int offset, String name) { 27 | super(IDENTIFIER, parent, offset); 28 | this.name = name; 29 | } 30 | 31 | public String getName() { 32 | return name; 33 | } 34 | 35 | @Override 36 | public int getEndOffset() { 37 | return getOffset() + name.length(); 38 | } 39 | @Override 40 | public String toString() { 41 | return super.toString() + "[" + name + "]"; 42 | } 43 | 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/tropyx/nb_puppet/parser/PNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 mkleint 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package com.tropyx.nb_puppet.parser; 19 | 20 | import java.util.Arrays; 21 | 22 | public class PNode extends PElement { 23 | private String[] names; 24 | 25 | public PNode(PElement parent, int offset) { 26 | super(NODE, parent, offset); 27 | } 28 | 29 | public String[] getNames() { 30 | return names; 31 | } 32 | 33 | void setNames(String[] names) { 34 | this.names = names; 35 | } 36 | 37 | 38 | @Override 39 | public String toString() { 40 | return super.toString() + "[" + Arrays.toString(names) + "]"; 41 | } 42 | 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/tropyx/nb_puppet/parser/PParamContainer.java: -------------------------------------------------------------------------------- 1 | 2 | package com.tropyx.nb_puppet.parser; 3 | 4 | public interface PParamContainer { 5 | 6 | PClassParam[] getParams(); 7 | 8 | void setParams(PClassParam[] params); 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/tropyx/nb_puppet/parser/PResourceAttribute.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 mkleint 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package com.tropyx.nb_puppet.parser; 19 | 20 | import org.netbeans.api.annotations.common.CheckForNull; 21 | 22 | public class PResourceAttribute extends PElement { 23 | private final String name; 24 | private PElement value; 25 | 26 | public PResourceAttribute(PElement parent, int offset, String name) { 27 | super(RESOURCE_ATTR, parent, offset); 28 | this.name = name; 29 | } 30 | 31 | public String getName() { 32 | return name; 33 | } 34 | 35 | @CheckForNull 36 | public PElement getValue() { 37 | return value; 38 | } 39 | 40 | public void setValue(PElement value) { 41 | this.value = value; 42 | } 43 | 44 | @Override 45 | public String toString() { 46 | return super.toString() + "[" + name + "->" + (value != null ? value.getClass() : "null") + "]"; 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/tropyx/nb_puppet/parser/PVariable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 mkleint 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package com.tropyx.nb_puppet.parser; 19 | 20 | /** 21 | * variable usage 22 | */ 23 | public class PVariable extends PElement { 24 | private final String name; 25 | 26 | public PVariable(PElement parent, int offset, String name) { 27 | super(VARIABLE, parent, offset); 28 | this.name = name; 29 | } 30 | 31 | public String getName() { 32 | return name; 33 | } 34 | 35 | @Override 36 | public String toString() { 37 | return super.toString() + "[" + name + "]"; 38 | } 39 | 40 | @Override 41 | public int getEndOffset() { 42 | //TODO not entirely true for string vars 43 | return getOffset() + name.length(); 44 | } 45 | 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/tropyx/nb_puppet/parser/PVariableDefinition.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 mkleint 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package com.tropyx.nb_puppet.parser; 19 | 20 | /** 21 | * variable definition 22 | */ 23 | public class PVariableDefinition extends PElement { 24 | private final String name; 25 | 26 | public PVariableDefinition(PElement parent, int offset, String name) { 27 | super(VARIABLE_DEFINITION, parent, offset); 28 | this.name = name; 29 | } 30 | 31 | public String getName() { 32 | return name; 33 | } 34 | 35 | @Override 36 | public String toString() { 37 | return super.toString() + "[" + name + "]"; 38 | } 39 | 40 | @Override 41 | public int getEndOffset() { 42 | return getOffset() + name.length(); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/tropyx/nb_puppet/parser/PuppetParserFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 mkleint 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package com.tropyx.nb_puppet.parser; 19 | 20 | import java.util.Collection; 21 | import org.netbeans.modules.parsing.api.Snapshot; 22 | import org.netbeans.modules.parsing.spi.Parser; 23 | import org.netbeans.modules.parsing.spi.ParserFactory; 24 | 25 | public class PuppetParserFactory extends ParserFactory { 26 | 27 | public PuppetParserFactory() { 28 | 29 | } 30 | 31 | @Override 32 | public Parser createParser(Collection clctn) { 33 | return new PuppetParser(); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/tropyx/nb_puppet/parser/PuppetParserResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 mkleint 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package com.tropyx.nb_puppet.parser; 19 | 20 | import org.netbeans.modules.parsing.api.Snapshot; 21 | import org.netbeans.modules.parsing.spi.Parser; 22 | 23 | public class PuppetParserResult extends Parser.Result { 24 | private final PElement root; 25 | 26 | public PuppetParserResult(Snapshot _snapshot, PElement root) { 27 | super(_snapshot); 28 | this.root = root; 29 | } 30 | 31 | @Override 32 | protected void invalidate() { 33 | 34 | } 35 | 36 | public PElement getRootNode() { 37 | return root; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/tropyx/nb_puppet/refactoring/PPElementContext.java: -------------------------------------------------------------------------------- 1 | 2 | package com.tropyx.nb_puppet.refactoring; 3 | 4 | import com.tropyx.nb_puppet.parser.PElement; 5 | import javax.swing.text.Document; 6 | import org.openide.text.CloneableEditorSupport; 7 | 8 | public class PPElementContext { 9 | private final int caretOffset; 10 | private final PElement rootNode; 11 | private final Document document; 12 | private final CloneableEditorSupport editorSupport; 13 | 14 | PPElementContext(CloneableEditorSupport editorSupport, Document doc, PElement rootNode, int caretOffset, int selectionStart, int selectionEnd) { 15 | this.rootNode = rootNode; 16 | this.caretOffset = caretOffset; 17 | this.document = doc; 18 | this.editorSupport = editorSupport; 19 | } 20 | 21 | public int getCaretOffset() { 22 | return caretOffset; 23 | } 24 | 25 | public PElement getRootNode() { 26 | return rootNode; 27 | } 28 | 29 | public PElement getCaretNode() { 30 | return rootNode.getChildAtOffset(caretOffset); 31 | } 32 | 33 | boolean isRefactoringAllowed() { 34 | return true; 35 | } 36 | 37 | Document getDocument() { 38 | return document; 39 | } 40 | 41 | public CloneableEditorSupport getEditorSupport() { 42 | return editorSupport; 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/tropyx/nb_puppet/refactoring/PPRefactoringFactory.java: -------------------------------------------------------------------------------- 1 | package com.tropyx.nb_puppet.refactoring; 2 | 3 | import org.netbeans.modules.refactoring.api.AbstractRefactoring; 4 | import org.netbeans.modules.refactoring.api.WhereUsedQuery; 5 | import org.netbeans.modules.refactoring.spi.RefactoringPlugin; 6 | import org.netbeans.modules.refactoring.spi.RefactoringPluginFactory; 7 | import org.openide.util.Lookup; 8 | 9 | /** 10 | * @author Milos Kleint 11 | */ 12 | @org.openide.util.lookup.ServiceProvider(service=org.netbeans.modules.refactoring.spi.RefactoringPluginFactory.class) 13 | public class PPRefactoringFactory implements RefactoringPluginFactory { 14 | 15 | public PPRefactoringFactory() { } 16 | 17 | @Override 18 | public RefactoringPlugin createInstance(AbstractRefactoring refactoring) { 19 | Lookup look = refactoring.getRefactoringSource(); 20 | PPElementContext context = look.lookup(PPElementContext.class); 21 | 22 | if (refactoring instanceof WhereUsedQuery) { 23 | if (context != null) { 24 | return new PPWhereUsedQueryPlugin((WhereUsedQuery)refactoring); 25 | } 26 | } 27 | return null; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/tropyx/nb_puppet/refactoring/PPWhereUsedElement.java: -------------------------------------------------------------------------------- 1 | 2 | package com.tropyx.nb_puppet.refactoring; 3 | 4 | import org.netbeans.modules.refactoring.spi.SimpleRefactoringElementImplementation; 5 | import org.openide.filesystems.FileObject; 6 | import org.openide.text.PositionBounds; 7 | import org.openide.util.Lookup; 8 | import org.openide.util.lookup.Lookups; 9 | 10 | public class PPWhereUsedElement extends SimpleRefactoringElementImplementation{ 11 | private final PositionBounds bounds; 12 | private final FileObject file; 13 | private final String text; 14 | 15 | public PPWhereUsedElement(String text, FileObject file, PositionBounds bounds) { 16 | this.text = text; 17 | this.file = file; 18 | this.bounds = bounds; 19 | } 20 | 21 | @Override 22 | public String getText() { 23 | return text; 24 | } 25 | 26 | @Override 27 | public String getDisplayText() { 28 | return text; 29 | } 30 | 31 | @Override 32 | public void performChange() { 33 | } 34 | 35 | @Override 36 | public Lookup getLookup() { 37 | return Lookups.singleton(file); 38 | } 39 | 40 | @Override 41 | public FileObject getParentFile() { 42 | return file; 43 | } 44 | 45 | @Override 46 | public PositionBounds getPosition() { 47 | return bounds; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/main/puppet42/augeas.pp: -------------------------------------------------------------------------------- 1 | define augeas ( 2 | $name , # (namevar) The name of this task. Used for... 3 | $changes , # The changes which should be applied to the... 4 | $context , # Optional context path. This value is prepended... 5 | $force , # Optional command to force the augeas type to... 6 | $incl , # Load only a specific file, e.g. `/etc/hosts`... 7 | $lens , # Use a specific lens, e.g. `Hosts.lns`. When this 8 | $load_path , # Optional colon-separated list or array of... 9 | $onlyif , # Optional augeas command and comparisons to... 10 | $provider , # The specific backend to use for this `augeas... 11 | $returns , # The expected return code from the augeas... 12 | $root , # A file system path; all files loaded by Augeas... 13 | $show_diff , # Whether to display differences when the file... 14 | $type_check , # Whether augeas should perform typechecking... 15 | ) 16 | { 17 | } 18 | -------------------------------------------------------------------------------- /src/main/puppet42/cron.pp: -------------------------------------------------------------------------------- 1 | define cron ( 2 | $name , # (namevar) The symbolic name of the cron job. This name is 3 | $ensure , # The basic property that the resource should be... 4 | $command , # The command to execute in the cron job. The... 5 | $environment , # Any environment settings associated with this... 6 | $hour , # The hour at which to run the cron job. Optional; 7 | $minute , # The minute at which to run the cron job... 8 | $month , # The month of the year. Optional; if specified... 9 | $monthday , # The day of the month on which to run the... 10 | $provider , # The specific backend to use for this `cron... 11 | $special , # A special value such as 'reboot' or 'annually'... 12 | $target , # The name of the crontab file in which the cron... 13 | $user , # The user who owns the cron job. This user must... 14 | $weekday , # The weekday on which to run the command... 15 | # ...plus any applicable metaparameters. 16 | ){ 17 | } -------------------------------------------------------------------------------- /src/main/puppet42/exec.pp: -------------------------------------------------------------------------------- 1 | define exec ( 2 | $command , # (namevar) The actual command to execute. Must either be... 3 | $creates , # A file to look for before running the command... 4 | $cwd , # The directory from which to run the command. If 5 | $environment , # Any additional environment variables you want to 6 | $group , # The group to run the command as. This seems to... 7 | $logoutput , # Whether to log command output in addition to... 8 | $onlyif , # If this parameter is set, then this `exec` will... 9 | $path , # The search path used for command execution... 10 | $provider , # The specific backend to use for this `exec... 11 | $refresh , # How to refresh this command. By default, the... 12 | $refreshonly , # The command should only be run as a refresh... 13 | $returns , # The expected exit code(s). An error will be... 14 | $timeout , # The maximum time the command should take. If... 15 | $tries , # The number of times execution of the command... 16 | $try_sleep , # The time to sleep in seconds between... 17 | $umask , # Sets the umask to be used while executing this... 18 | $unless , # If this parameter is set, then this `exec` will... 19 | $user 20 | 21 | ) { 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/main/puppet42/group.pp: -------------------------------------------------------------------------------- 1 | define group ( 2 | $name , # (namevar) The group name. While naming limitations vary by 3 | $ensure , # Create or remove the group. Valid values are... 4 | $allowdupe , # Whether to allow duplicate GIDs. Defaults to... 5 | $attribute_membership , # Whether specified attribute value pairs should... 6 | $attributes , # Specify group AIX attributes in an array of... 7 | $auth_membership , # whether the provider is authoritative for group... 8 | $forcelocal , # Forces the management of local accounts when... 9 | $gid , # The group ID. Must be specified numerically.... 10 | $ia_load_module , # The name of the I&A module to use to manage this 11 | $members , # The members of the group. For directory services 12 | $provider , # The specific backend to use for this `group... 13 | $system , # Whether the group is a system group with lower... 14 | # ...plus any applicable metaparameters. 15 | ){} 16 | -------------------------------------------------------------------------------- /src/main/puppet42/host.pp: -------------------------------------------------------------------------------- 1 | define host ( 2 | $name , # (namevar) The host... 3 | $ensure , # The basic property that the resource should be... 4 | $comment , # A comment that will be attached to the line with 5 | $host_aliases , # Any aliases the host might have. Multiple... 6 | $ip , # The host's IP address, IPv4 or... 7 | $provider , # The specific backend to use for this `host... 8 | $target , # The file in which to store service information. 9 | # ...plus any applicable metaparameters. 10 | ){} 11 | -------------------------------------------------------------------------------- /src/main/puppet42/interface.pp: -------------------------------------------------------------------------------- 1 | define interface ( 2 | $name , # (namevar) The interface's... 3 | $ensure , # The basic property that the resource should be... 4 | $allowed_trunk_vlans , # Allowed list of Vlans that this trunk can... 5 | $description , # Interface... 6 | $device_url , # The URL at which the router or switch can be... 7 | $duplex , # Interface duplex. Valid values are `auto`... 8 | $encapsulation , # Interface switchport encapsulation. Valid... 9 | $etherchannel , # Channel group this interface is part of. Values 10 | $ipaddress , # IP Address of this interface. Note that it might 11 | $mode , # Interface switchport mode. Valid values are... 12 | $native_vlan , # Interface native vlan (for access mode only).... 13 | $provider , # The specific backend to use for this `interface` 14 | $speed , # Interface speed. Valid values are `auto`... 15 | # ...plus any applicable metaparameters. 16 | ){} 17 | -------------------------------------------------------------------------------- /src/main/puppet42/mount.pp: -------------------------------------------------------------------------------- 1 | 2 | define mount ( 3 | $name , # (namevar) The mount path for the... 4 | $ensure , # Control what to do with this mount. Set this... 5 | $atboot , # Whether to mount the mount at boot. Not all... 6 | $blockdevice , # The device to fsck. This is property is only... 7 | $device , # The device providing the mount. This can be... 8 | $dump , # Whether to dump the mount. Not all platform... 9 | $fstype , # The mount type. Valid values depend on the... 10 | $options , # A single string containing options for the... 11 | $pass , # The pass in which the mount is... 12 | $provider , # The specific backend to use for this `mount... 13 | $remounts , # Whether the mount can be remounted `mount -o... 14 | $target , # The file in which to store the mount table.... 15 | # ...plus any applicable metaparameters. 16 | ){} -------------------------------------------------------------------------------- /src/main/puppet42/package.pp: -------------------------------------------------------------------------------- 1 | define package ( 2 | $provider , # (namevar) The specific backend to use for this `package... 3 | $name , # (namevar) The package name. This is the name that the... 4 | $ensure , # What state the package should be in. On... 5 | $adminfile , # A file containing package defaults for... 6 | $allow_virtual , # Specifies if virtual package names are allowed... 7 | $allowcdrom , # Tells apt to allow cdrom sources in the... 8 | $category , # A read-only parameter set by the... 9 | $configfiles , # Whether configfiles should be kept or replaced. 10 | $description , # A read-only parameter set by the... 11 | $flavor , # OpenBSD supports 'flavors', which are further... 12 | $install_options , # An array of additional options to pass when... 13 | $instance , # A read-only parameter set by the... 14 | $package_settings , # Settings that can change the contents or... 15 | $platform , # A read-only parameter set by the... 16 | $reinstall_on_refresh , # Whether this resource should respond to refresh... 17 | $responsefile , # A file containing any necessary answers to... 18 | $root , # A read-only parameter set by the... 19 | $source , # Where to find the package file. This is only... 20 | $status , # A read-only parameter set by the... 21 | $uninstall_options , # An array of additional options to pass when... 22 | $vendor , # A read-only parameter set by the... 23 | ) {} 24 | -------------------------------------------------------------------------------- /src/main/puppet42/service.pp: -------------------------------------------------------------------------------- 1 | define service ( 2 | $name , # (namevar) The name of the service to run. This name is... 3 | $ensure , # Whether a service should be running. Valid... 4 | $binary , # The path to the daemon. This is only used for... 5 | $control , # The control variable used to manage services... 6 | $enable , # Whether a service should be enabled to start at... 7 | $flags , # Specify a string of flags to pass to the startup 8 | $hasrestart , # Specify that an init script has a `restart... 9 | $hasstatus , # Declare whether the service's init script has a... 10 | $manifest , # Specify a command to config a service, or a path 11 | $path , # The search path for finding init scripts.... 12 | $pattern , # The pattern to search for in the process table... 13 | $provider , # The specific backend to use for this `service... 14 | $restart , # Specify a *restart* command manually. If left... 15 | $start , # Specify a *start* command manually. Most... 16 | $status , # Specify a *status* command manually. This... 17 | $stop , # Specify a *stop* command... 18 | # ...plus any applicable metaparameters. 19 | ){} 20 | -------------------------------------------------------------------------------- /src/main/puppet42/ssh_authorized_key.pp: -------------------------------------------------------------------------------- 1 | define ssh_authorized_key ( 2 | $name , # (namevar) The SSH key comment. This attribute is currently 3 | $ensure , # The basic property that the resource should be... 4 | $key , # The public key itself; generally a long string... 5 | $options , # Key options; see sshd(8) for possible values... 6 | $provider , # The specific backend to use for this... 7 | $target , # The absolute filename in which to store the SSH... 8 | $type , # The encryption type used. Valid values are... 9 | $user , # The user account in which the SSH key should be... 10 | # ...plus any applicable metaparameters. 11 | ){} 12 | -------------------------------------------------------------------------------- /src/main/puppet42/sshkey.pp: -------------------------------------------------------------------------------- 1 | define sshkey ( 2 | $name , # (namevar) The host name that the key is associated... 3 | $ensure , # The basic property that the resource should be... 4 | $host_aliases , # Any aliases the host might have. Multiple... 5 | $key , # The key itself; generally a long string of... 6 | $provider , # The specific backend to use for this `sshkey... 7 | $target , # The file in which to store the ssh key. Only... 8 | $type , # The encryption type used. Probably ssh-dss or... 9 | # ...plus any applicable metaparameters. 10 | ){} 11 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/Bundle.properties: -------------------------------------------------------------------------------- 1 | OpenIDE-Module-Display-Category=Infrastructure 2 | OpenIDE-Module-Long-Description=\ 3 |

Puppet Configuration Editor

\nThis is a module for editing Puppet configurations.\n \ 4 | It identifies a puppet config tree by the presence\n of a manifests/site.pp file.\n\ 5 |

\n\n

Copyright (C) Tropyx Technology Pty Ltd and Michael Lindner 2013

\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n \n \ 6 | This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. \ 7 | See the\n GNU General Public License for more details.\n\n \ 8 | You should have received a copy of the GNU General Public License\n along with this program. \ 9 | If not, see . 10 | OpenIDE-Module-Name=Puppet Configuration Editor 11 | OpenIDE-Module-Short-Description=Puppet Configuration Editor Plugin for the NetBeans IDE 12 | Editors/text/x-puppet-manifest/FontsColors/NetBeans/Defaults/FontAndColors.xml=Puppet 13 | 14 | text/x-puppet-manifest=Puppet 15 | character=Character 16 | errors=Error 17 | identifier=Identifier 18 | keyword=Keyword 19 | literal=Literal 20 | comment=Comment 21 | number=Number 22 | operator=Operator 23 | string=String 24 | separator=Separator 25 | whitespace=Whitespace 26 | method-declaration=Functions 27 | variable-declaration=Variable Declaration 28 | regexp=RegExp 29 | resource-name=Resource type 30 | resource-parameter=Resource parameter 31 | resource-metaparameter=Resource metaparameter 32 | local-variable=Locally defined variables 33 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/PuppetManifestTemplate.pp: -------------------------------------------------------------------------------- 1 | 2 | # Puppet Manifest File 3 | # Created with the Puppet Plugin for Netbeans. 4 | 5 | node default { 6 | 7 | 8 | 9 | } 10 | 11 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/PuppetManifestTypeDescription.html: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |

Manifest File

This is the standard .pp file for Puppet Configuration.
25 | 26 | 27 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/SimplePreview.pp: -------------------------------------------------------------------------------- 1 | node 'aaa-hosted' { 2 | # comment here 3 | require companysoe 4 | 5 | include java 6 | 7 | $java_version = 'jdk1.7.0_40' 8 | $arch = 'x86_64' 9 | 10 | java::jdk { $java_version: 11 | arch => $arch, 12 | } 13 | 14 | class { 'java::defaultversion': 15 | version => $java_version, 16 | } 17 | 18 | class { 'buildeng_aaa': 19 | type => 'hosted', 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/fontsAndColors.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/hiera/Bundle.properties: -------------------------------------------------------------------------------- 1 | HieraPanel.txtHieraLocation.text= 2 | HieraPanel.lblHiera.text=Hiera Yaml File: 3 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/lint/Bundle.properties: -------------------------------------------------------------------------------- 1 | LintPanelUI.jLabel1.text=Available Puppet Lint checks: 2 | LintPanelUI.cbReadRakefile.text=Use Rakefile values when available 3 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/newproject/Bundle.properties: -------------------------------------------------------------------------------- 1 | LBL_CreateProjectStep=Name and Location 2 | PuppetModulePanelVisual.projectNameLabel.text=Project &Name: 3 | PuppetModulePanelVisual.createdFolderLabel.text=Project &Folder: 4 | PuppetModulePanelVisual.browseButton.actionCommand=BROWSE 5 | PuppetModulePanelVisual.browseButton.text=Br&owse... 6 | PuppetModulePanelVisual.projectLocationLabel.text=Project &Location: 7 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/newproject/PuppetModuleDescription.html: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 21 | 22 | Sample Puppet Module project 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/newproject/PuppetModuleProject.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tropyx/NetBeansPuppet/327704bb0e6216cca42de791a5210556beae6568/src/main/resources/com/tropyx/nb_puppet/newproject/PuppetModuleProject.zip -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/Bundle.properties: -------------------------------------------------------------------------------- 1 | # Copyright (C) Tropyx Technology Pty Ltd and Michael Lindner 2013 2 | # 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation, either version 3 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program. If not, see . 15 | 16 | OpenIDE-Module-Name=NewSnippets2 17 | 18 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/apache_vhost/ApacheVhost.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | Apache Vhost 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/apache_vhost/Bundle.properties: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2013 kzs9j6 2 | # 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation, either version 3 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program. If not, see . 15 | 16 | ApacheVhostCustomizer.jLabel1.text_1=PuppetMaster 17 | ApacheVhostCustomizer.jTextField1.text_1= 18 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/assorted/Class.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 20 | 21 | 22 | 23 | 24 | 33 | 34 | 35 | 36 | 37 | 38 | Class 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/assorted/Cron.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | "/usr/sbin/logrotate", 28 | user => root, 29 | hour => ['2-4'], 30 | minute => '*/10' 31 | } ]]> 32 | 33 | 34 | 35 | 36 | 37 | Crontab 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/assorted/Exec.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | "/var/tmp", 28 | creates => "/var/tmp/myfile", 29 | path => ["/usr/bin", "/usr/sbin"], 30 | logoutput => on_failure 31 | ## change on_failure to true to log everything 32 | } 33 | ]]> 34 | 35 | 36 | 37 | 38 | 39 | 40 | Exec 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/assorted/Filebucket.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | puppet, 29 | path => false, 30 | # Due to a known issue, path must be set to false for remote filebuckets. 31 | } 32 | 33 | # Specify it as the default target 34 | File { backup => main } 35 | 36 | 37 | ]]> 38 | 39 | 40 | 41 | 42 | 43 | 44 | Filebucket 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/assorted/IfElse.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | stopped, 29 | enable => false, 30 | } 31 | } 32 | else { 33 | service { 'ntpd': 34 | name => 'ntpd', 35 | ensure => running, 36 | enable => true, 37 | hasrestart => true, 38 | require => Package['ntp'], 39 | } 40 | } ]]> 41 | 42 | 43 | 44 | 45 | 46 | If - Else 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/assorted/Node.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | Node 38 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/assorted/Notify.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | Debug Message 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/assorted/Package.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | installed, 28 | source => 'N:/packages/mysql-5.5.16-winx64.msi', 29 | install_options => [ '/S', { 'INSTALLDIR' => 'C:\mysql-5.5' } ], 30 | } 31 | 32 | ]]> 33 | 34 | 35 | 36 | 37 | 38 | 39 | Package 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/assorted/StageFirst.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | "first" ]]> 28 | 29 | ]]> 30 | 31 | 32 | 33 | 34 | 35 | Stage - First 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/puppetfile/Bundle.properties: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2013 kzs9j6 2 | # 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation, either version 3 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program. If not, see . 15 | 16 | PuppetFileCustomizer.jLabel1.text_1=File Name 17 | PuppetFileCustomizer.jTextField1.text_1=Enter File Name Here 18 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/puppetfile/PuppetFile.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | File Directive 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/puppetmaster/Bundle.properties: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (C) 2013 kzs9j6 3 | 4 | # This program is free software: you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation, either version 3 of the License, or 7 | # (at your option) any later version. 8 | 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program. If not, see . 16 | 17 | PuppetMasterCustomizer.jLabel1.text_1=PuppetMaster 18 | PuppetMasterCustomizer.jTextField1.text_1= -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/puppetmaster/PuppetMaster.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | PuppetMaster 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/architecture.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | architecture 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/arp.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | arp 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/augeasversion.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | augeasversion 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/boardmanufacturer.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | boardmanufacturer 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/boardproductname.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | boardproductname 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/boardserialnumber.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | boardserialnumber 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/cfkey.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | cfkey 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/domain.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | domain 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/ec2_userdata.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | ec2_userdata 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/facterversion.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | facterversion 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/fqdn.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | fqdn 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/hardwareisa.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | hardwareisa 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/hardwaremodel.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | hardwaremodel 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/hostname.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | hostname 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/id.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | id 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/interfaces.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | interfaces 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/ipaddress.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | ipaddress 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/ipaddress6.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | ipaddress6 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/iphostnumber.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | iphostnumber 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/is_virtual.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | is_virtual 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/kernel.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | kernel 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/kernelmajversion.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | kernelmajversion 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/kernelrelease.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | kernelrelease 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/kernelversion.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | kernelversion 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/lsbdistcodename.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | lsbdistcodename 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/lsbdistdescription.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | lsbdistdescription 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/lsbdistid.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | lsbdistid 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/lsbdistrelease.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | lsbdistrelease 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/lsbmajdistrelease.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | lsbmajdistrelease 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/lsbrelease.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | lsbrelease 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/macaddress.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | macaddress 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/macosx_buildversion.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | macosx_buildversion 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/macosx_productname.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | macosx_productname 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/macosx_productversion.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | macosx_productversion 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/macosx_productversion_major.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | macosx_productversion_major 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/macosx_productversion_minor.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | macosx_productversion_minor 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/manufacturer.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | manufacturer 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/memoryfree.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | memoryfree 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/memorysize.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | memorysize 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/netmask.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | netmask 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/newCron.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | ]]> 26 | 27 | 28 | 29 | 30 | 31 | New Line 32 | ]]> 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/operatingsystem.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | operatingsystem 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/operatingsystemrelease.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | operatingsystemrelease 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/osfamily.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | osfamily 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/path.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | path 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/physicalprocessorcount.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | physicalprocessorcount 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/processor.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | processor 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/processorcount.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | processorcount 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/productname.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | productname 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/ps.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | ps 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/puppetversion.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | puppetversion 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/rubysitedir.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | rubysitedir 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/rubyversion.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | rubyversion 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/selinux.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | selinux 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/selinux_config_mode.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | selinux_config_mode 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/selinux_config_policy.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | selinux_config_policy 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/selinux_current_mode.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | selinux_current_mode 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/selinux_enforced.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | selinux_enforced 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/selinux_mode.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | selinux_mode 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/selinux_policyversion.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | selinux_policyversion 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/serialnumber.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | serialnumber 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/sshdsakey.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | sshdsakey 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/sshecdsakey.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | sshecdsakey 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/sshrsakey.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | sshrsakey 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/swapencrypted.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | swapencrypted 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/swapfree.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | swapfree 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/swapsize.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | swapsize 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/timezone.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | timezone 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/type.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | type 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/uniqueid.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | uniqueid 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/uptime.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | uptime 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/uptime_days.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | uptime_days 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/uptime_hours.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | uptime_hours 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/uptime_seconds.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | uptime_seconds 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/virtual.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | virtual 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/vlans.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | vlans 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/palette/variables/xendomains.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | xendomains 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/resources/PuppetMaster16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tropyx/NetBeansPuppet/327704bb0e6216cca42de791a5210556beae6568/src/main/resources/com/tropyx/nb_puppet/resources/PuppetMaster16.png -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/resources/PuppetMaster32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tropyx/NetBeansPuppet/327704bb0e6216cca42de791a5210556beae6568/src/main/resources/com/tropyx/nb_puppet/resources/PuppetMaster32.png -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/resources/editor-preferences.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/resources/function.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tropyx/NetBeansPuppet/327704bb0e6216cca42de791a5210556beae6568/src/main/resources/com/tropyx/nb_puppet/resources/function.png -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/resources/pp-file_icon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tropyx/NetBeansPuppet/327704bb0e6216cca42de791a5210556beae6568/src/main/resources/com/tropyx/nb_puppet/resources/pp-file_icon.gif -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/resources/puppet16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tropyx/NetBeansPuppet/327704bb0e6216cca42de791a5210556beae6568/src/main/resources/com/tropyx/nb_puppet/resources/puppet16.png -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/resources/puppet_icon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tropyx/NetBeansPuppet/327704bb0e6216cca42de791a5210556beae6568/src/main/resources/com/tropyx/nb_puppet/resources/puppet_icon.gif -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/resources/resources.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tropyx/NetBeansPuppet/327704bb0e6216cca42de791a5210556beae6568/src/main/resources/com/tropyx/nb_puppet/resources/resources.gif -------------------------------------------------------------------------------- /src/main/resources/com/tropyx/nb_puppet/resources/variable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tropyx/NetBeansPuppet/327704bb0e6216cca42de791a5210556beae6568/src/main/resources/com/tropyx/nb_puppet/resources/variable.png -------------------------------------------------------------------------------- /src/test/java/com/tropyx/nb_puppet/hyperlink/PHyperlinkProviderTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 mkleint 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package com.tropyx.nb_puppet.hyperlink; 18 | 19 | import org.junit.Test; 20 | import static org.junit.Assert.*; 21 | import org.openide.util.Pair; 22 | 23 | /** 24 | * 25 | * @author mkleint 26 | */ 27 | public class PHyperlinkProviderTest { 28 | 29 | public PHyperlinkProviderTest() { 30 | } 31 | 32 | 33 | @Test 34 | public void testGetPathAndVariable() { 35 | PHyperlinkProvider inst = new PHyperlinkProvider(); 36 | Pair tup = inst.getPathAndVariable("mod::params::var"); 37 | assertEquals("mod/manifests/params.pp", tup.first()); 38 | assertEquals("$var", tup.second()); 39 | 40 | tup = inst.getPathAndVariable("mod::foo::params::var"); 41 | assertEquals("mod/manifests/foo/params.pp", tup.first()); 42 | assertEquals("$var", tup.second()); 43 | 44 | tup = inst.getPathAndVariable("mod::var"); 45 | assertEquals("mod/manifests/init.pp", tup.first()); 46 | assertEquals("$var", tup.second()); 47 | } 48 | 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/test/java/com/tropyx/nb_puppet/parser/PStringTest.java: -------------------------------------------------------------------------------- 1 | package com.tropyx.nb_puppet.parser; 2 | 3 | import java.util.List; 4 | import org.junit.Test; 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * 9 | * @author mkleint 10 | */ 11 | public class PStringTest { 12 | 13 | public PStringTest() { 14 | } 15 | 16 | @Test 17 | public void testVariables() { 18 | PString v = new PString(null, 0, "\"aaa${bbb::ccc}/${ddd::eee}fff\""); 19 | List ch = v.getChildrenOfType(PVariable.class, true); 20 | assertEquals(2, ch.size()); 21 | assertEquals("$bbb::ccc", ch.get(0).getName()); 22 | assertEquals("$ddd::eee", ch.get(1).getName()); 23 | assertEquals(5, ch.get(0).getOffset()); 24 | assertEquals(17, ch.get(1).getOffset()); 25 | } 26 | 27 | 28 | } 29 | --------------------------------------------------------------------------------