Questions tagged [conditional]

54 questions
2
votes
1 answer

exim route file condition

Using exim4 I have set up a route to use an external SMTP server. I am using cPanel which keeps a list of domains set up locally on the server in the file: /etc/localdomains . As a result I have set up a condition to only send through this relay if…
Jacob
  • 210
  • 2
  • 8
2
votes
3 answers

Write an apache configuration, with condition based on the apache version

I want to write a configuration for an apache server which should work for apache-2.2 and -2.4 without alterations. Since there are a quite a few new modules in v2.4 which have to be loaded,and a few altered directives, I will need some conditional…
mat
  • 548
  • 6
  • 20
2
votes
2 answers

Nginx - Apply basic auth only if an htaccess file exists

How can I apply basic auth only if an htaccess file exists? If first tried to put the auth_basic directives in an if block, but that is not allowed. Then, I tried redirecting to a named location, but while the location with basic auth works fine,…
surj
  • 243
  • 4
  • 15
2
votes
1 answer

IF Condition in Apache 2.4 is always executed

I am trying to load a module based on a condition. {PHPMODULENAME} is replaced in the config by the AMP Server I am using - so please don't get confused. LoadModule module1 "..."
ESP32
  • 73
  • 7
2
votes
0 answers

Conditional directives based on User-Agent with Apache 2.2.x?

I want to implement something like the following in our Apache httpd configuration: RemoveEncoding .gz .tgz AddType application/x-gzip .gz but my understanding is that this…
1
vote
1 answer

Gitlab CI/CD with conditional scripts

Here is what I wish to do in GitLab CI/CD: Whenever something is pushed into a specific branch I wish to have multiple scrips and CI/CD should decide which script should be run based on the pushed files list. For example: IF anything changed in…
Bert
  • 1,028
  • 1
  • 16
  • 33
1
vote
1 answer

Puppet user creation with condition

How to create user with same UID(only if it doesn't exists) without affecting the servers having the same user with random UIDs. To give more insight: 1. Maintain a user, "user1" all across the fleet of servers with same UID 2. A considerable number…
Nithya Bee
  • 13
  • 3
1
vote
3 answers

Ansible - Is it possible to skip the execution of a role?

Here is my main playbook, which launch the roles listed below --- - hosts: slaves roles: - ntp - nmap - tcpdump - unattended-upgrades - traceroute - apache - mysql I would like to let the user decide if…
Osh
  • 11
  • 1
  • 2
1
vote
2 answers

SaltStack: Do x if /var/log/backup exists

I want to execute this state: backup_log_readable: acl.present: - name: /var/log/backup - acl_type: user - acl_name: monitor - perms: rx - recurse: True But this should happen only if /var/log/backup exists. How to do…
guettli
  • 3,591
  • 17
  • 72
  • 123
1
vote
1 answer

Windows Server conditional forwarders does not work on one of the domain controllers

With few words, the problem is that few domain names are not resolved by workstations in our network, while doing it from Remote Desktop session on the server succeeds. Now the details. We have a Windows domain network behind a router. Internal…
1
vote
1 answer

Ansible: trying to put conditionals on a vars file

I'm working on a project that will use a number of devices that will need to be configured with the same plays, but separate variables. I have a vars file which includes a number of libraries, one for each device. The name of the library matches the…
Disco King
  • 11
  • 2
1
vote
1 answer

Conditionals in cmd scripts

I'm doing scripting using appcmd. What I'd like to do is check to see if a given site exists and if does perform an action. In this case, delete it. appcmd list app | find "mySite" So, if the find "mySite" returns any text, I'd like to execute a…
Frank V
  • 449
  • 4
  • 15
1
vote
1 answer

Conditional dependencies in CHEF

I have a complicated software stack that I manage with 2 recipes. recipe[stack::foo] recipe[stack::bar] foo is installed on every server, whereas bar is installed on only a subset of servers. bar depends on the file and service foo.…
spuder
  • 1,725
  • 3
  • 26
  • 42
1
vote
0 answers

AD DNS conditional forwarding returns short name instead of fqdn

First of all this isn't a copy of DNS Conditional forwarder returns NETBIOS instead of FQDN (just sounds very similar). We have two separate domains that do conditional forwarding to eachother. Each of these domains is spread across the same three…
1
vote
2 answers

Conditionally Rewrite Email Headers (From & Reply-To) Exchange 2010

I have a client who maintains Company A (with email addresses %username%@companyA.com) and they own the domain companyB.com however there is no "infrastructure" (no Exchange server) set up specifically for companyB.com. My client needs to be able…
NorthVandea
  • 11
  • 1
  • 3