r/sysadmin • • Nov 28 '20

Is scripting (bash/python/powershell) being frowned upon in these days of "configuration management automation" (puppet/ansible etc.)?

How in your environment is "classical" scripting perceived these days? Would you allow a non-admin "superuser" to script some parts of their workflows? Are there any hard limits on what can and cannot be scripted? Or is scripting being decisively phased out?

Configuration automation has gone a long way with tools like puppet or ansible, but if some "superuser" needed to create a couple of python scripts on their Windows desktops, for example to create links each time they create a folder would it allowed to run? No security or some other unexpected issues?

363 Upvotes

281 comments sorted by

View all comments

Show parent comments

192

u/[deleted] Nov 28 '20

"I tried to use GPO to do it, but it didn't work. Now I tell everyone that GPO is flaky and unreliable because I made assumptions about how it works, and when it didn't work that way, I gave up instead of figuring out why"

I've met people with over a decade of windows experience like this. The most common error? Adding computers to a group, adding that group to a GPO, then rage quitting when the GPO didn't get applied to the computers.

34

u/Ssakaa Nov 28 '20

Could be worse, I've known people that think RAID is evil because they once had an issue where they couldn't recover a failed array... that they had no backups on... and after that refused to use it out of the assumption that they could recover from individual disks more reliably if one failed...

They did at least start making backups...

17

u/BrFrancis Nov 28 '20

Why is raid 0 a level? If raid is "redundant array of i-word disks" ... How is there a level of raid that isn't redundant.

What's really evil, is accessing files on network shares using iscsi so you can device mapper them into a raid 10 configuration and present that to a VM. Muahahahahhaha

10

u/Ssakaa Nov 28 '20

I mean, at that point, the word redundant is redundant, isn't it?

Redundant (adj): not or no longer needed or useful; superfluous.

And, the data itself must be superfluous, if someone's going to put it at that much excessive risk, so it sorta fits that the word stays...

→ More replies (1)

10

u/AmericanGeezus Sysadmin Nov 28 '20

Cause there is zero redundancy, duuuuuh.

→ More replies (4)

97

u/jews4beer Sysadmin turned devops turned dev Nov 28 '20

The "I can't figure out how it works therefore it sucks and is an unreliable tool" is a mindset that is pervasive across the entire IT industry.

28

u/CraigAT Nov 28 '20

True. But this also highlights the inability of IT companies to make products that work as users expect.

20

u/skat_in_the_hat Nov 28 '20

Sometimes you have to break the assumed mindset for something to work better. Look at the refusal to use SELinux by admins.

14

u/CraigAT Nov 28 '20

Agreed. The customer is not always right, but sometimes neither is the developer.

14

u/corsicanguppy DevOps Zealot Nov 28 '20

Agreed. Look at SELinux .

→ More replies (1)

6

u/Paraxic Nov 28 '20

NGL selinux is a pita, probably does a good job at what it's supposed to do but the tools for it are tedious to say the least.

→ More replies (3)
→ More replies (4)
→ More replies (2)
→ More replies (2)

17

u/[deleted] Nov 28 '20

[removed] — view removed comment

34

u/Yescek Nov 28 '20

That comment is a bit of a "gotcha". That example doesn't really have enough detail to really get into the specific fix.

Possible solution would be to create an OU specifically for the subset of computers you're trying to apply the GPO to, then link the GPO to said OU.

Would need to make sure your new OU isn't inheriting any GPOs that could potentially conflict though.

15

u/Resolute002 Nov 28 '20

Also for some GPOs they don't take full effect until after restarts. In this era of largely remote work with the pandemic this surprises people all the time.

10

u/StatefulDecay Nov 28 '20

Especially when adding computers to security groups. The PC only checks for what it is a member of at restarts.

18

u/Resolute002 Nov 28 '20

When you add in this pandemic, and computers restarting off site... all of a sudden doing it by PowerShell doesn't seem so stupid.

→ More replies (1)

6

u/Smartguy5000 Sysadmin Nov 28 '20

This will allow you to pull updated membership on a comp account sans restart. https://www.normanbauer.com/2016/03/30/how-to-purge-kerberos-tickets-of-the-system-account/

→ More replies (6)
→ More replies (1)

17

u/Komnos Restitutor Orbis Nov 28 '20

Applying the GPO to whatever OU(s) the computers are in. Applying a GPO to a group is just a filter; it still won't apply to anything outside of the locations it's been linked to, even if they're members of the filtered group.

11

u/jpmoney Burned out Grey Beard Nov 28 '20

A powershell script, obviously.

→ More replies (1)
→ More replies (1)

5

u/Inaspectuss Custom Nov 28 '20

To be fair, GP can be really frustrating to deal with at times, especially preferences. That said, when you have it set properly, it’s bulletproof.

The type of person you’re talking about is the same kind to dump everything in Default Domain Policy. People see GUI and think “oh, I can just click through it and read descriptions”. Nope. You need to learn it inside and out.

0

u/[deleted] Nov 28 '20

[deleted]

→ More replies (2)

4

u/lokes2k Nov 28 '20

I'm pretty certain I work for that guy...

4

u/figuresys Nov 28 '20

"I tried to use GPO to do it, but it didn't work. Now I tell everyone that GPO is flaky and unreliable because I made assumptions about how it works, and when it didn't work that way, I gave up instead of figuring out why"

You've got this SO on-point, except it's for EVERYTHING. My God, people just don't try to stretch their brains and then just give up and declare that thing bad.

4

u/korewarp Nov 29 '20

Because most people in my age group are used to some kind of fucking feedback from the software we use. It's not our fault that you create a GPO, add users/computers to it and then it just.. sits there. You run gpupdate on a few PCs and the GPO gets applied to.. some of them? Where's the fucking consistency. At least running a PS script does what you fucking expect it to.

I'm not saying GPOs are bad at all, GPOs have their uses and are a strong and powerful tool for any windows sysadmin. But I can definitely understand why certain 'immediate change' use cases require PS for consistent results.

→ More replies (15)