Questions tagged [automation]
the field of converting any manual process into one that can be run mostly, or entirely, "hands-free"
639
questions
744
votes
9
answers
2.3m
views
How to automate SSH login with password?
How to automate SSH login with password?
I'm configuring my test VM, so heavy security is not considered. SSH chosen for acceptable security with minimal configuration.
ex)
echo password | ssh id@...
83
votes
4
answers
45k
views
Automate the installation of postfix on Ubuntu
My system configuration script does an apt-get install -y postfix. Unfortunately the script is halted when the postfix installer displays a configuration screen. Is there a method to force postfix to ...
38
votes
7
answers
52k
views
Ssh, run a command on login, and then Stay Logged In?
I tried this with expect, but it didn't work: it closed the connection at the end.
Can we run a script via ssh which will log into remote machines, run a command, and not disconnect?
So ssh in a ...
37
votes
8
answers
128k
views
Ansible: Conditionally define variables in vars file if a certain condition is met
Depending on the value(True/False) of a variable defined into the group_vars I am trying to define some variables in a vars file. Their value depends on the group var's value.
My current var file ...
33
votes
4
answers
61k
views
How do I run my PowerShell scripts in parallel without using Jobs?
If I have a script that I need to run against multiple computers, or with multiple different arguments, how can I execute it in parallel, without having to incur the overhead of spawning a new PSJob ...
32
votes
6
answers
8k
views
Automatically Configure New Computers
My company is in the process of upgrading all of our users from old Windows XP computers to newer quad-core Win7 computers. This is a good thing - it's long overdue that we upgrade our workstations - ...
29
votes
5
answers
4k
views
How can a Linux Administrator improve their shell scripting and automation skills?
In my organization, I work with a group of NOC staff, budding junior engineers and a handful of senior engineers; all with a focus on Linux. One interesting step in the way the company grows talent is ...
27
votes
7
answers
5k
views
Automating server deployment
I find i am constantly settings up pretty much nearly identical servers and VPSs for a number of my clients and it can be very time consuming. Often the only thing that changes between each deployment ...
26
votes
7
answers
38k
views
git clone - fail instead of prompting for credentials
When cloning git repositories in automated tools - web front ends, CI systems, sometimes the git clone invocation opens up a prompt asking for the username and password (for example, when cloning a ...
25
votes
5
answers
65k
views
How do I install an app from Windows Store using Powershell
I know if I have .appx package file, I can install it via powershell with the Add-AppxPackage cmdlet.
However, I simply want to download & install Microsoft Store packages by name.
I don't want ...
24
votes
3
answers
35k
views
Putting RSA keys into azure key vault
How can I store my key pair (typically the id_rsa and id_rsa.pub) in azure key vault.
I want to put the public key in my GIT service and allow a virtual machine to download the private key from Azure ...
22
votes
6
answers
42k
views
Alter charset and collation in all columns in all tables in MySQL
I need to execute these statements in all tables for all columns.
alter table table_name charset=utf8;
alter table table_name alter column column_name charset=utf8;
Is it possible to automate this ...
21
votes
1
answer
17k
views
How can I prepend to PATH while running Ansible's pip module?
I'm attempting to install psycopg2 into a Python virtualenv with Ansible's pip module, but I need to prepend an entry to PATH for it to build correctly (it needs to know the path to the directory ...
20
votes
7
answers
38k
views
Cygwin SSHd Autoblock Failed Logins
I'm running Cygwin with an SSH deamon on a Windows Server 2008 machine. I was looking at the Event Viewer and noticed as much as 5 to 6 failed login attempts per second (brute force) for the last week ...
19
votes
6
answers
96k
views
Adding a user to the local Administrator group using powershell
I would like to use PowerShell to add a specific user to the local administrator group on a machine. I would be running the PowerShell script in the context of a user that has Administration rights ...
18
votes
9
answers
43k
views
How to set ulimits for a service starting at boot?
I need, for mysql to use large-pages, to set a ulimit - I've done this in limits.conf. However, limits.conf (pam_limits.so), doesn't get read in for init, only for "real" shells. I solved this before ...
16
votes
8
answers
8k
views
Method to integrate Powershell scripts with non-Windows workflow?
I love the smell of new machines in the morning.
I'm automating a machine creation workflow that involves several separate systems across my infrastructure, some of which involve 15 year old perl ...
12
votes
2
answers
10k
views
Limit SSH key to SCP only
Problem:
I don't have root access to the server (i.e, I can't/don't want to change any system-wide server configuration), and I want to use scp with an alternative Identity File (e.g, .ssh/...
11
votes
1
answer
5k
views
Shared files/templates between cookbooks
We have multiple cookbooks which reference the same files and templates and were wondering if there is a reasonable way to ensure all of these are the same file to ensure that none go out of date. Is ...
11
votes
5
answers
13k
views
Execute command when a file changes
I have a scenario where I am uploading .csv files to a specific folder, /tmp/data_upload, every day, and the old files are replaced by the new one.
I need to run a Python script once the data is ...
10
votes
5
answers
14k
views
How do I install a yum package group with puppet?
Does puppet have a way to install a yum package group (e.g. 'Development Tools'), besides exec?
9
votes
5
answers
12k
views
Send message to IRC channel from bash
I have installed ircd-hybrid on my Ubuntu Server (192.168.1.2, example.com).
We use #teamchannel to communicate inside the team.
The question is: how can I send some short message from example.com to #...
9
votes
7
answers
13k
views
How can I automate clearing and resetting a Linux user's home directory to a default?
I'm helping to teach two Unix courses next week. Users will be granted an account on a RHEL 5 machine, during which time they'll add files to their /home folder, update their .bashrc and other ...
9
votes
3
answers
23k
views
Start services.msc attached to remote computer
Is there a way to start services.msc already attached to a remote system (e.g. from command line)? I want to avoid clicking Action -> Connect to remote computer, because I have to do it so often...
9
votes
3
answers
3k
views
Automatic rollout of VLAN (and other) configs to Procurve switches
I've got a pile of switches connecting everything together at our DC, 50 racks or so worth of kit. It's starting to be a problem to login to every single one of them to make configuration changes -- ...
9
votes
1
answer
5k
views
How can I modify an existing scheduled task using Powershell?
I am working on some release automation scripts that use Powershell to update existing scheduled tasks which execute various applications. In my script, I can set the Path and Working Directory of the ...
9
votes
3
answers
15k
views
Remotely renaming a domained Win 7 computer
I'm having a hard time figuring out how to rename a Windows 7 computer remotely. This is for automating Win 7 builds in a vSphere 5 environment, and I'm trying to get it as hands-off as I can. So far ...
8
votes
7
answers
29k
views
How can I disable a scheduled task using Powershell?
I have a web application that runs on Windows Server 2008 R2, which has a large number of scheduled tasks which take care of all the backend stuff. When I do a software deployment which touches the ...
8
votes
5
answers
4k
views
How to automate slipstream?
Since years I use slipstreamed Windows installations. This works very well, but preparing them is tedious :
1 - install a Windows with the last slipstreamed version we have (automated install)
2 - ...
8
votes
3
answers
3k
views
Is it possible to create a generalized configuration file for installing Windows features using PowerShell?
I'm currently trying to automate the build of a VM running Windows Server 2012 R2. At the moment the challenge is automating the addition of roles and features. Within the roles and features wizard ...
8
votes
1
answer
67k
views
What does /v/qn parameter do for windows silent installers?
This page says to do a silent install you pass in the parameters /s /v/qn. It mentions what /s does - silent install - but not what /v/qn does.
So what does it do? Why the weird format? (on one ...
8
votes
4
answers
16k
views
How to do mysql_secure_installation via ansible playbook?
I managed to install Apache Mysql/Mariadb and PHP using playbook. How can I do mysql_secure_installation using ansible?
I am a beginner in Ansible. I want to set a new password to MySQL server and ...
8
votes
1
answer
1k
views
Entering local admin username and password in a script
I have alot of clients on my network and I want my script to do the following:
[1] Open an elevated command prompt using the local admin details.
Note: I do not want to have to enter a username ...
8
votes
1
answer
811
views
FreeBSD `freebsd-update` automation?
freebsd-update command prints updating entries after it downloaded. But it shows them with more. So I have to press some spaces to continue. Is there a way to avoid this behavior? I want to execute ...
8
votes
3
answers
6k
views
Deploy our own software using Puppet?
(Apologies in advance for the stupidity in this question. I'm normally a programmer, not a sysadmin, but I've taken it upon myself to automate some things, and clean up some other things which are ...
8
votes
2
answers
3k
views
How to set only specific nginx server block into maintenance mode programmatically
I am looking for a solution to automate one of our application's deployment process. In the beginning of deployment, I would like to programmatically set the specified server into maintenance mode and ...
8
votes
4
answers
848
views
Configuration management: Cross-machine dependencies
I've used tools like puppet to manage individual systems, with generally a high level of success. Where puppet falls down is that it isn't good at managing dependencies outside of an individual ...
7
votes
4
answers
11k
views
Perl or Python, better suited for Unix system automation?
I have been using bash for most of my system administration tasks. I also know a bit of perl.
Should I learn Python or Perl is better for system automation. So far from my experience learning perl ...
7
votes
6
answers
19k
views
easiest way to automate all software installations for new users/computers?
Basically, for every new user we have about 30 different installers that all need to be run manually after an install of windows which is tedious/time consuming.
We can't simply ghost/image the ...
7
votes
5
answers
16k
views
Secure method of changing a user's password via Python script/non-interactively
Questions
Is there a more secure/better way for setting a user's password non-interactively via a Python script? My current solution uses chpasswd from a Fabric script. Another option would be to use ...
7
votes
2
answers
2k
views
How to change assigned letter for Ephemeral drives automatically?
I have an AWS Windows box (Windows 2008 R2) with the following disks:
C:\ 60 Gb (EBS)
D:\ 200 Gb (EBS)
Y:\ 40 Gb (Ephemeral SSD)
Z:\ 40 Gb (Ephemeral SSD)
Every time it boots I change ephemeral ...
7
votes
3
answers
4k
views
How to copy many Scheduled Tasks between Windows Server 2008 machines?
I have several standalone Win2008 (R1+R2) servers (no domain) and each of them has dozens of scheduled tasks. Each time we set up a new server, all these tasks have to be created on it.
The tasks are ...
7
votes
3
answers
1k
views
Creating a script to install a Perl application and its dependencies automatically
I have a Perl application that needs a lot of dependencies that i need to deploy on numerous servers
I would like to make a script that installs that Perl application automatically and quickly.
To ...
6
votes
2
answers
3k
views
How To Shutdown Ubuntu Automatically X Minutes After Starting Up?
How would one automatically shutdown an ubuntu OS 30 minutes after it was turned on? Or 15 minutes after it was turned on? Etc?
I tried creating an init.d script like so:
shutdown -h +5
But my box ...
6
votes
5
answers
390
views
How do you optimize new user setup?
What's your top trick for getting a new employee set up quickly? Do you use images, scripts, something else?
6
votes
1
answer
4k
views
Run specific script after every Windows Update
Is there a way to run a specific script each time Windows update completes (i.e., after reboot or after an update that doesn't require a reboot)?
My application is suffering from MSCOMCTL.OCX updates,...
6
votes
3
answers
406
views
too many crons - too many machines !
I have the following problem:
too many machines.
some groups of machines share the same cron configuration, some not.
sometimes, I need to add a crontab entry manually in hundreds of machines.
I'm ...
6
votes
7
answers
3k
views
Automating Administration Tasks on Windows
What tools do you use and recommend for automating administration tasks for Windows-based computers?
Examples of such tasks include:
Installing/upgrading software
Standarizing application settings
...
6
votes
2
answers
4k
views
How to detect timeouts in an expect script
Consider an expect script that spawns a command and waits for a sequence of events. We use this to test software. I'm trying to always get a failure return value from the script when there is a ...
6
votes
3
answers
255
views
Protocol choice for Machine-to-Machine communication - level:n00b
I am building a monitoring system for an irrigation pump and the connected pipeline. So far I have completed the sensor network. Everything connects to a micro-controller board (actually 4 Teensy 3.0 ...