{"id":16492369,"url":"https://github.com/ulhpc/puppet-bash","last_synced_at":"2025-03-21T07:31:39.548Z","repository":{"id":32700267,"uuid":"36289710","full_name":"ULHPC/puppet-bash","owner":"ULHPC","description":"Configure and manage Bourne Again SHell (Bash) dotfiles","archived":false,"fork":false,"pushed_at":"2024-06-13T14:53:00.000Z","size":109,"stargazers_count":4,"open_issues_count":2,"forks_count":1,"subscribers_count":9,"default_branch":"devel","last_synced_at":"2025-03-17T22:41:53.552Z","etag":null,"topics":["bashrc","dotfiles","puppet"],"latest_commit_sha":null,"homepage":null,"language":"Puppet","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ULHPC.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/contributing/index.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-26T10:48:36.000Z","updated_at":"2024-06-13T14:53:03.000Z","dependencies_parsed_at":"2023-01-14T21:58:30.592Z","dependency_job_id":null,"html_url":"https://github.com/ULHPC/puppet-bash","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ULHPC%2Fpuppet-bash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ULHPC%2Fpuppet-bash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ULHPC%2Fpuppet-bash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ULHPC%2Fpuppet-bash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ULHPC","download_url":"https://codeload.github.com/ULHPC/puppet-bash/tar.gz/refs/heads/devel","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244757972,"owners_count":20505545,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bashrc","dotfiles","puppet"],"created_at":"2024-10-11T14:05:24.962Z","updated_at":"2025-03-21T07:31:39.217Z","avatar_url":"https://github.com/ULHPC.png","language":"Puppet","funding_links":[],"categories":[],"sub_categories":[],"readme":"-*- mode: markdown; mode: visual-line;  -*-\n\n# Bash Puppet Module\n\n[![Puppet Forge](http://img.shields.io/puppetforge/v/ULHPC/bash.svg)](https://forge.puppetlabs.com/ULHPC/bash)\n[![License](http://img.shields.io/:license-Apache2.0-blue.svg)](LICENSE)\n![Supported Platforms](http://img.shields.io/badge/platform-debian|redhat|centos-lightgrey.svg)\n[![Documentation Status](https://readthedocs.org/projects/ulhpc-puppet-bash/badge/?version=latest)](https://readthedocs.org/projects/ulhpc-puppet-bash/?badge=latest)\n\nConfigure and manage Bourne Again SHell (Bash) dotfiles and profiles\n\n      Copyright (c) 2019 UL HPC Team \u003chpc-sysadmins@uni.lu\u003e\n      \n\n| [Project Page](https://github.com/ULHPC/puppet-bash) | [Sources](https://github.com/ULHPC/puppet-bash) | [Documentation](https://ulhpc-puppet-bash.readthedocs.org/en/latest/) | [Issues](https://github.com/ULHPC/puppet-bash/issues) |\n\n## Synopsis\n\nConfigure and manage Bourne Again SHell (Bash) dotfiles and profile.\r\n Bourne Again SHell (Bash) is the GNU Project's shell. Bash is an sh-compatible shell that incorporates useful features from the Korn shell (ksh) and C shell (csh). It is intended to conform to the IEEE POSIX P1003.2/ISO 9945.2 Shell and Tools standard. It offers functional improvements over sh for both programming and interactive use. In addition, most sh scripts can be run by Bash without modification..\n\nThis module implements the following elements:\n\n* __Puppet classes__:\n    - `bash`\n    - `bash::common`\n    - `bash::common::debian`: specific implementation under Debian\n    - `bash::common::redhat`: specific implementation under Redhat-like system\n    - `bash::params`: module parameters\n\n* __Puppet definitions__:\n    - `bash::setup`\n    - `bash::config`\n\nAll these components are configured through a set of variables you will find in\n[`manifests/params.pp`](manifests/params.pp).\n\n_Note_: the various operations that can be conducted from this repository are piloted from a [`Rakefile`](https://github.com/ruby/rake) and assumes you have a running [Ruby](https://www.ruby-lang.org/en/) installation.\nSee `docs/contributing.md` for more details on the steps you shall follow to have this `Rakefile` working properly.\n\n## Dependencies\n\nSee [`metadata.json`](metadata.json). In particular, this module depends on\n\n* [puppetlabs/stdlib](https://forge.puppetlabs.com/puppetlabs/stdlib)\n* [puppetlabs/vcsrepo](https://forge.puppetlabs.com/puppetlabs/vcsrepo)\n* [puppetlabs/concat](https://forge.puppetlabs.com/puppetlabs/concat)\n* [unibet/profiled](https://forge.puppetlabs.com/unibet/profiled)\n\n## Overview and Usage\n\n### Class `bash`\n\nThis is the main class defined in this module.\nIt accepts the following parameters:\n\n* `$ensure`: default to 'present', can be 'absent'\n* `$aliases`: Hash of key / command values to place in a aliases files\n* `$aliases_file`:      configuration file where the aliases are placed.\n    - _Default_: `/etc/profiles.d/bash_aliases.sh`\n* `$dotfiles_provider`: Type of dotfiles provider\n    - _Default_: `git`\n* `$dotfiles_src`:  URL of the [Git] repository hosting the dotfiles. Note that it is expected that this dotfiles directory contains an installation script `install.sh` at the root of the repository that accept the '`--delete`' command.\n\t- _Default:_ \u003chttps://github.com/ULHPC/dotfiles.git\u003e.\n* `$dotfiles_revision`: [git] branch / revision / tag to use.\n    - _Default:_  `master`\n\nUse it as follows:\n\n     include ' bash'\n\nSee also [`tests/init.pp`](tests/init.pp)\n\n\n### Definition `bash::setup`\n\nThe definition `bash::setup` configures `.bashrc` and many other dotfiles (`.inputrc`, `.vimrc`, [`.screenrc`](https://www.gnu.org/software/screen/manual/html_node/Startup-Files.html), bash aliases etc. ) for a given user within a given home directory (hopefully **his** home directory) using specific configuration (see \u003chttps://github.com/ULHPC/dotfiles\u003e).\nTo do that, it relies on an installation script named [`install.sh`](https://github.com/ULHPC/dotfiles/blob/master/install.sh) available at the root of repository that accepts also the '`--delete`' command-line option to remove / uninstall the dotfiles.\n\nThis definition accepts the following parameters:\n\n* `$ensure`: default to 'present', can be 'absent'\n* `$path`: If the title of the resource is not the homedir to consider, use the `path` parameter to precise the homedir to setup\n* `$user`: User that run the setup. **BEWARE** that it **SHALL** be the owner of the home directory you're trying to setup!!!! `bash::setup` does not make extra checks to detect it so pay attention to it.\n   - _Default_: `root`\n* `$group`: As above but for the group operating the commands. **BEWARE** again to use the appropriate group!\n   - _Default_: `root`\n\nExample:\n\n      include bash\n\n      bash::setup{ '/home/vagrant':\n          ensure =\u003e 'present',\n          user   =\u003e 'vagrant',\n          group  =\u003e 'vagrant',\n      }\n\nSee also [`tests/vagrant_setup.pp`](tests/vagrant_setup.pp) or [`tests/vagrant_setup_absent.pp`](tests/vagrant_setup_absent.pp)\n\n### Definition `bash::config`\n\nPermit to define a global or local bash configuration.\n\n* _Global_ configurations are placed in `/etc/profile.d/\u003ctitle\u003e.bash`\n* _Local_ configurations are placed in `\u003crootdir\u003e/.bash[.before].d/\u003ctitle.bash\u003e`\n\nThis definition accepts the following parameters:\n\n* `$ensure`: default to 'present', can be 'absent'\n* `$content`:  Specify the contents of the `bash::config` entry as a string. Newlines, tabs, and spaces can be specified using the escaped syntax (e.g., \\n for a newline)\n* `$source`: Copy a file as the content of the `bash::config` entry\n* `$rootdir`: Specifies a root directory hosting the bash configuration file.\n    - Set it to a homedir (and precise the `owner` and `group` directives) to make the configuration local and placed in `\u003crootdir\u003e/.bash[.before].d/\u003ctitle\u003e.bash`\n* `$owner`: specifies the owner of the destination file\n   - _Default_: `root`\n* `$group`: specifies a permissions group for the destination file.\n   - _Default_: `root`\n* `$mode`: Specifies the permissions mode of the destination file.\n   - _Default_: `0644`\n* `$before_hook`: specifies if the bash configuration should be placed as a before hook. Only valid if rootdir is set.\n   - _Default_: `false`\n* `$warn`: Specifies whether to add a header message at the top of the destination file. Valid options: the booleans 'true' and 'false', or a string to serve as the header.\n   - _Default_: `false`\n\nExample:\n\n      include bash\n\n      # Install in /etc/profile.d\n      bash::config{ 'modules':\n         ensure  =\u003e 'present',\n         warn    =\u003e true,\n         content =\u003e \"# Environment Module Path\n\t  export MODULEPATH='$HOME/.local/easybuild/modules/all:/opt/apps/easybuild/modules/all:/opt/apps/default/modules/all:$HOME/privatemodules:$HOME/easybuild/modules/all'\"\n      }\n\nSee also [`tests/config.pp`](tests/config.pp) or [`tests/config_vagrant.pp`](tests/config_vagrant.pp)\n\n\n## Librarian-Puppet / R10K Setup\n\nYou can of course configure the bash module in your `Puppetfile` to make it available with [Librarian puppet](http://librarian-puppet.com/) or\n[r10k](https://github.com/adrienthebo/r10k) by adding the following entry:\n\n     # Modules from the Puppet Forge\n     mod \"ULHPC/bash\"\n\nor, if you prefer to work on the git version:\n\n     mod \"ULHPC/bash\",\n         :git =\u003e 'https://github.com/ULHPC/puppet-bash',\n         :ref =\u003e 'production'\n\n## Issues / Feature request\n\nYou can submit bug / issues / feature request using the [ULHPC/bash Puppet Module Tracker](https://github.com/ULHPC/puppet-bash/issues).\n\n## Developments / Contributing to the code\n\nIf you want to contribute to the code, you shall be aware of the way this module is organized.\nThese elements are detailed on [`docs/contributing.md`](contributing/index.md).\n\nYou are more than welcome to contribute to its development by [sending a pull request](https://help.github.com/articles/using-pull-requests).\n\n## Puppet modules tests within a Vagrant box\n\nThe best way to test this module in a non-intrusive way is to rely on [Vagrant](http://www.vagrantup.com/).\nThe `Vagrantfile` at the root of the repository pilot the provisioning various vagrant boxes available on [Vagrant cloud](https://atlas.hashicorp.com/boxes/search?utf8=%E2%9C%93\u0026sort=\u0026provider=virtualbox\u0026q=svarrette) you can use to test this module.\n\nSee [`docs/vagrant.md`](vagrant.md) for more details.\n\n## Online Documentation\n\n[Read the Docs](https://readthedocs.org/) aka RTFD hosts documentation for the open source community and the [ULHPC/bash](https://github.com/ULHPC/puppet-bash) puppet module has its documentation (see the `docs/` directly) hosted on [readthedocs](http://ulhpc-puppet-bash.rtfd.org).\n\nSee [`docs/rtfd.md`](rtfd.md) for more details.\n\n## Licence\n\nThis project and the sources proposed within this repository are released under the terms of the [Apache-2.0](LICENCE) licence.\n\n\n[![Licence](https://www.apache.org/images/feather-small.gif)](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fulhpc%2Fpuppet-bash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fulhpc%2Fpuppet-bash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fulhpc%2Fpuppet-bash/lists"}