Skip to content

Instantly share code, notes, and snippets.

@brokenthumbs
brokenthumbs / delete_git_submodule.md
Created August 2, 2019 21:39 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
### Keybase proof
I hereby claim:
* I am brokenthumbs on github.
* I am brokenthumbs (https://keybase.io/brokenthumbs) on keybase.
* I have a public key whose fingerprint is 5473 9CC2 7BBE 88AB 42FA A9CF EB0E FB48 091B FA54
To claim this, I am signing this object:
@brokenthumbs
brokenthumbs / main_playbook.yml
Last active February 10, 2016 22:44
Ansible Parallel Plays Example
---
- include: playbook_1.yml
- include: playbook_2.yml
file { '/tmp/server.cert':
ensure => present,
source => 'puppet:///certs/server.cert',
mode => '0400',
owner => puppet,
group => puppet,
} ->
java_ks { 'puppetca:keystore':
ensure => 'latest',
certificate => '/tmp/server.cert',
resources { "firewall":
purge => true
}
Firewall {
before => Class['my_fw::post'],
require => Class['my_fw::pre'],
}
class { ['my_fw::pre', 'my_fw::post']: }
class { 'firewall': }
[main]
# The Puppet log directory.
# The default value is '$vardir/log'.
logdir = /var/log/puppet
# Where Puppet PID files are kept.
# The default value is '$vardir/run'.
rundir = /var/run/puppet
# Where SSL certificates are kept.
---
:backends:
- yaml
:hierarchy:
- %{environment}
- common
:yaml:
:datadir: /etc/puppet/hieradata
#!/bin/bash
# hostname: service01.s.example.com
case $(hostname) in
*q.example.com ) echo "environment=qa";;
*s.example.com ) echo "environment=stage";;
*p.example.com ) echo "environment=production";;
esac
require 'fileutils'
require 'nokogiri'
folder = "modules"
files = []
Dir.glob("#{folder}/**/output.xml").each do |f|
files << f
end
source "http://rubygems.org"
gem "rspec-puppet"
gem "puppet"
gem "puppet-lint"
gem "nokogiri"