Exemplo n.º 1
0
        public SiteDesiredState(Site iisSiteObject
                                , IEnumerable <WebConfigPropertyDesiredState> authDesiredStateList
                                , IISCodeGenerator.IisPoolAndSitesOptions iisOptions)
        {
            var rootApp = iisSiteObject.Applications[0];

            this.Key = GetSiteKey(iisSiteObject.Name);

            this.AddAttribute("Name", iisSiteObject.Name);
            this.AddAttribute("Ensure", "Present");
            this.AddAttribute("State", iisSiteObject.State.ToString());

            this.ApplicationPool = rootApp.ApplicationPoolName;
            this.AddAttribute("ApplicationPool", this.ApplicationPool);

            this.AddAttributeWithComment("PhysicalPath", rootApp.VirtualDirectories[0].PhysicalPath, "This folder must already exist");

            if (iisOptions.StandardizeLogFileLocation)
            {
                this.AddAttributeWithOverrideValue("LogFileDirectory", @"D:\IISLogs", iisSiteObject.LogFile.Directory);
            }
            else
            {
                this.AddAttribute("LogFileDirectory", iisSiteObject.LogFile.Directory);
            }

            this.AddAttribute("DependsOn", "[cAppPool]" + PoolDesiredState.GetPoolVariableName(this.ApplicationPool));

            this.Bindings     = GetBindings(iisSiteObject.Bindings);
            this.Applications = GetApplications(iisSiteObject.Applications, this.Key, this.Name);
            this.AuthDesiredStateList.AddRange(authDesiredStateList);
        }
Exemplo n.º 2
0
        private static string GeneratePool(PoolDesiredState poolCode, int poolCounter)
        {
            string code = poolCode.GetCode(2);

            string poolMinStr = (poolCounter % 60).ToString("00");

            code = code.Replace("#PoolRecycleMins#", poolMinStr + ":00");
            return(code);
        }
Exemplo n.º 3
0
		public List<PoolDesiredState> BuildPools(IISCodeGenerator.IisPoolAndSitesOptions iisOptions)
		{
			ServerManager serverManager = new ServerManager();
			List<PoolDesiredState> poolCodeList = new List<PoolDesiredState>();

			var pools = serverManager.ApplicationPools;

			foreach (var pool in pools)
			{
				var poolCode = new PoolDesiredState(pool, iisOptions);
				poolCodeList.Add(poolCode);
			}

			return poolCodeList;
		}
Exemplo n.º 4
0
        public List <PoolDesiredState> BuildPools(IISCodeGenerator.IisPoolAndSitesOptions iisOptions)
        {
            ServerManager           serverManager = new ServerManager();
            List <PoolDesiredState> poolCodeList  = new List <PoolDesiredState>();

            var pools = serverManager.ApplicationPools;

            foreach (var pool in pools)
            {
                var poolCode = new PoolDesiredState(pool, iisOptions);
                poolCodeList.Add(poolCode);
            }

            return(poolCodeList);
        }
Exemplo n.º 5
0
        private void Initialize(Application application, string siteKey, string siteName)
        {
            this.Key = GetApplicationVariableName(siteKey, application.Path);
            this.IsRootApplication = (application.Path == "/");

            AddAttribute("Name", application.Path);
            AddAttribute("Ensure", "Present");
            AddAttribute("Website", siteName);
            AddAttribute("PhysicalPath", application.VirtualDirectories[0].PhysicalPath);

            this.ApplicationPool = application.ApplicationPoolName;
            AddAttribute("WebAppPool", this.ApplicationPool);

            AddAttribute("DependsOn", "[cAppPool]" + PoolDesiredState.GetPoolVariableName(application.ApplicationPoolName));

            this.VirtualDirectories = GetVirtualDirectories(application.VirtualDirectories, siteName, application.Path);
        }
Exemplo n.º 6
0
        private void Initialize(Application application, string siteKey, string siteName, WebAuthenticationInformation authInfo)
        {
            this.Key = GetApplicationVariableName(siteName, application.Path);
            this.IsRootApplication = (application.Path == "/");

            string name = application.Path.StartsWith("/") ? application.Path.Substring(1) : application.Path;

            AddAttribute("Name", name);

            AddAttribute("Ensure", "Present");
            AddAttribute("Website", siteName);
            AddAttribute("PhysicalPath", application.VirtualDirectories[0].PhysicalPath);

            this.ApplicationPool = application.ApplicationPoolName;
            AddAttribute("WebAppPool", this.ApplicationPool);

            AddAttribute("DependsOn", "[xWebAppPool]" + PoolDesiredState.GetPoolVariableName(application.ApplicationPoolName));

            this.VirtualDirectories = GetVirtualDirectories(application.VirtualDirectories, siteName, application.Path);
            this.AuthenticationInfo = authInfo;
        }
Exemplo n.º 7
0
        public SiteDesiredState(Site iisSiteObject
                                , List <WebConfigEntry> configEntries
                                , IISCodeGenerator.IisPoolAndSitesOptions iisOptions)
        {
            var rootApp = iisSiteObject.Applications[0];

            this.Key = GetSiteKey(iisSiteObject.Name);

            this.AddAttribute("Name", iisSiteObject.Name);
            this.AddAttribute("Ensure", "Present");
            this.AddAttribute("State", iisSiteObject.State.ToString());

            this.ApplicationPool = rootApp.ApplicationPoolName;
            this.AddAttribute("ApplicationPool", this.ApplicationPool);

            this.AddAttributeWithComment("PhysicalPath", rootApp.VirtualDirectories[0].PhysicalPath, "This folder must already exist");

            string logAttributeName = "LogPath";

            if (iisOptions.StandardizeLogFileLocation)
            {
                this.AddAttributeWithOverrideValue(logAttributeName, "$logFilePath", iisSiteObject.LogFile.Directory);
            }
            else
            {
                this.AddAttribute(logAttributeName, iisSiteObject.LogFile.Directory);
            }

            this.AddAttribute("DependsOn", "[xWebAppPool]" + PoolDesiredState.GetPoolVariableName(this.ApplicationPool));

            this.Bindings = GetBindings(iisSiteObject.Bindings);

            this.AuthenticationInfo = GetSiteAuthenticationConfiguration(configEntries, iisSiteObject.Name);

            Dictionary <string, WebAuthenticationInformation> authEntries = GetAppsAuthenticationConfigurations(configEntries);

            this.Applications = GetApplications(iisSiteObject.Applications, this.Key, this.Name, authEntries);

            //todo this.AllWebConfigEntryList.AddRange(configEntries);
        }
Exemplo n.º 8
0
 private static string GeneratePool(PoolDesiredState poolCode)
 {
     return(poolCode.GetCode(2));
 }
Exemplo n.º 9
0
		private static string GeneratePool(PoolDesiredState poolCode)
		{
			return poolCode.GetCode(2);
		}